Resize still broken in Magic Fields

86 visningar
Hoppa till det första olästa meddelandet

volderette

oläst,
15 sep. 2010 03:57:122010-09-15
till Magic Fields
Hello,

i use the following code to generate my images:


$pictures = get_field_duplicate('Preview');
$i = 0;
foreach($pictures as $picture){

$i++;

$previmage = simplexml_load_string(gen_image('Preview',
1,$i,array('h' => 600, 'w' => 800, 'zc' => 0, 'aoe' => 0)));
$lowres = simplexml_load_string(gen_image('Preview',
1,$i,array('h' => 1200, 'w' => 1200, 'zc' => 0, 'aoe' => 0, 'q' =>
95)));

echo "<li><a class='noicon' rel='fancybox' href='".
$previmage['src']."'><img src='".$picture['t']."' alt='".
$picstripped."' height='120px' width='170px'/></a>";
echo "<li><a href='".$picture['o']."' title='".$picstripped." High
Resolution' target='_blank'>high-res</a></li>";
echo "<li><a href='".$lowres['src']."' title='".$picstripped." Low
Resolution' target='_blank'>low-res</a></li>";

It used to work fine with an older version of MagicFields, but now the
images are not resized, but stretched.

I understand that you stripped phpthumb for performance issues and i
really like this, but right now i have to use phpthumb to get the
resizing to work as expected.

For now im back to phpthumb_old (as shown in your wiki), but now when
i upload a picture it has the wrong permissions (chmod600) and
therefore it cant be viewed (browser gives a 403 error).


Hope you can help me with this. I'd really like to get rid of
phpthumb, but right now its not possible.

Thanks,

Andi

volderette

oläst,
15 sep. 2010 04:02:132010-09-15
till Magic Fields
Im using version 1.4.1 right now.

brando...@gmail.com

oläst,
15 sep. 2010 23:00:442010-09-15
till Magic Fields
I was in the same situation, I didn't like how the new way images were
either being cropped or stretched. and i couldn't get it to function
like before. i didn't want to re-add phpthumb either. in the magic
fields plugin, there is a file "MF_thumb.php". the new images sizing
is mostly in here it looks like. it also looks like they based much
of the code on some internal WP image_resize functions. but not 100%,
if you replace line 118 to line 174 of MF_thumb.php with this code (is
from the WP internal resize function), you might get the results you
are looking. it works for me...

//new code (borrowed from wp)

// don't crop, just resize using $dest_w x $dest_h as a maximum
bounding box
$crop_w = $orig_w;
$crop_h = $orig_h;

$s_x = 0;
$s_y = 0;

list( $new_w, $new_h ) = wp_constrain_dimensions( $orig_w, $orig_h,
$dest_w, $dest_h );
}


brandon

Hunk

oläst,
15 sep. 2010 23:58:312010-09-15
till Magic Fields
add phpthumb support (phpthumb_old) and use get_image_p and
gen_image_p

On Sep 15, 10:00 pm, "brandon.s...@gmail.com" <brandon.s...@gmail.com>
wrote:

volderette

oläst,
17 sep. 2010 05:00:382010-09-17
till Magic Fields
Thanks Brandon, i will try that.

Regarding phpthumb_old: Im using it right now, but i changes all the
permissions to chmod 600 so i cant view it in the browser.

volderette

oläst,
17 sep. 2010 05:13:002010-09-17
till Magic Fields
Changing the code in MF_thumbs.php works just fine. Thanks a lot!

@Hunk: Just curious: Is there a reason why you using a different code
there?
Svara alla
Svara författaren
Vidarebefordra
0 nya meddelanden