Issue:
- cropping creates black area in cropped image (ex:https://www.saludmedica.com/sites/default/files/styles/location_small_th...)

I'm running:
- Drupal 7.22
- Imagecrop 7.x-1.0-rc3+56-dev
- Patch #28 applied https://drupal.org/node/1924078

Temporary fix:
- delete image in styles directory and view node with image (this works, but after a while it defaults to image with black area)

I appreciate any feedback!

CommentFileSizeAuthor
#1 imagecrop-black_area-2101757-1.patch1.08 KBdonatasp

Comments

donatasp’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

Here's a quick patch to remove wrong assumption that there will be only one image generated per request. Bug is exposed by using image_style_create_derivative(), which, for example, in our case is used in galleryformatter module.

This patch does not affect API and leaves ImageCrop::getInstance() method as is, which might mislead further developers in thinking that ImageCrop implements singleton pattern. I don't feel familiar enough with imagecrop to do pervasive changes and lack of test suit does not add to my courage. I hope current maintainer can sort this out completely.

ianthomas_uk’s picture

@donatasp Just to clarify, are you saying that you were seeing this black area problem when using galleryformatter and that you tracked it down to this singleton pattern?

I've been playing around with galleryformatter and can't reproduce the problem, can you provide any steps to reproduce?

Thanks

moehac’s picture

@ianthomas_uk, I noticed you removed:

public static function getInstance($image = NULL)

from most recent update. You decided to take a different route?

ianthomas_uk’s picture

ianthomas_uk’s picture

@moehac If by "latest update" you mean RC3 then that is very out of date.

It looks like the code with the problem was originally written to solve a similar problem. The commit message was "Fixed js bug when crop selection would go outside image"
http://drupalcode.org/project/imagecrop.git/commitdiff/82756fad99ae1a7ed...

moehac’s picture

@ianthomas_uk, yes, I was referring to RC3. Ok, good, I have upgraded the module and have not seen any issues.

Thanks for this great module!

ianthomas_uk’s picture

Issue summary: View changes
Status: Needs review » Closed (cannot reproduce)

OK, I'm going to close this then as the reporter is saying it's working - please reopen with steps to reproduce if anyone belives it is still a problem.

@donatasp I'm not sure if your patch was meant to fix the black area problem. If it was, please reopen this issue with steps to reproduce. If it caused other problems please open a new issue clearly describing the problem with steps to reproduce and your patch. Thanks.