Thumbnail Cropping
Permalink
This code used to work in PHP 5.6 but when I upgraded to PHP7.1 yesterday, this code isn't working anymore
I read that the image helper is deprecated, so is there another option that has the same effect? I mean the cropping.
$ih = Loader::helper('image'); $thumb = $ih->getThumbnail($thumbnail, 185, 139, true); echo '<img src="' . $thumb->src . '" />
I read that the image helper is deprecated, so is there another option that has the same effect? I mean the cropping.
This is basically the same.
I tried that but the same thing actually, the images are stil not showing.
$im = Core::make('helper/image'); $thumb = $im->getThumbnail($thumbnail, 180, 120, true); echo '<img src="' . $thumb->src . '" />';
This works in 8.3.2 (the code came from the core image block). What is your $thumbnail and what version are you using?
Some checks on if you have an object (probably on both variables) would prevent errors from showing. Could be that the system can't create the thumbnail (in /application/files - due to rights or space even) and/or the file you're passing isn't found.