Bug fix: crop_and_resize

edited February 2013 in Bug Reports
I found and fixed a bug on v1.0:
I couldn't figure out why my thumbnails were so screwed up, AND my original was resized. It took a while, but I found out that the thumb_marker wasn't being set when passing the images to the resize_and_crop() function.

I added:
'thumb_marker' => '_thumb';
to line 124 of \fuel\modules\fuel\libraries\Fuel_assets.php

It works beautifully now.

I hope this helps.

Comments

  • edited 5:45AM
    Though I did notice the line:
    // image manipulation parameters must all be FALSE or NULL or else it will trigger the image_lib image processing

    So perhaps there's a better place to put this?
  • edited 5:45AM
    Was this an issue when you were saving from the Assets module?
  • edited 5:45AM
    From saving in a simple module, using create_thumb = true and resize_method = resize_and_crop on a file field.
  • edited 5:45AM
    Does it also work correctly for you instead you change MY_Image_lib on line 33 to something like this:
    protected $_thumb_marker = '_thumb';
  • edited 5:45AM
    Yes, that worked perfectly.
  • edited 5:45AM
    OK. After looking at it a bit more, I think the best implementation is the previous fix you mentioned plus adding the following code to Fuel_assets around line 310 to prevent the error if you don't select the create thumbnail button:
    // to fix issues with resize and crop if (empty($params['create_thumb'])) { $params['thumb_marker'] = ''; }
  • edited 5:45AM
    Yep, that worked just fine.

    BTW, the updates to the CKEditor JS has been perfect so far. Love it.

    Only thing I can't wait to see is how you plan to implement the new CKEditor 4 into the front-end editing. That's so exciting!

    Wish I could help, but I'm still a little too green at the advanced JS.
Sign In or Register to comment.