Closed (fixed)
Project:
Imagefield Crop
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jan 2012 at 14:58 UTC
Updated:
30 Jan 2013 at 01:27 UTC
Jump to comment: Most recent file
Comments
Comment #1
skilip commentedHere's the patch
Comment #2
bdu commentedThese are the same symptoms in #1345744: cropped image has incorrect metadata width and height in imagefield. The caching of the width and height is something introduced in core 7.9 with the fix for #1129642: Populate HTML image tags with dimension attributes (like D6 imagefield) without re-introducing I/O. This patch more or less undoes the effect of that fix.
The current behaviour is that image.field module stores the dimensions. It tries to do that with as little i/o as possible. It stores the original dimensions in the form. Because it misses that imagefield_crop has (correctly) changed the image, it uses these original dimensions from the form and not the actual dimensions of the cropped image. We need to fix the core image module.
Comment #3
michaelfavia commentedThank you i was battling scale and resize issues until i found this issue.
Comment #4
elliotttf commentedThis patch resets the item's width and height after cropping.
Comment #5
elliotttf commentedOk, not sure why I thought that last patch was working but it's not, the function that calls the widget_value function only allows the fid to be changed. Here's another patch that does work but feels a little "heavy handed".
Comment #6
rgnyldz commentedI'm applying the patch manually (Notepad). Found a similar function. Maby from the early patches I applied. Don't know really.
I'm using 7.x-2.x-dev and the last patch works fine for me. Croped image width & height is correct.
Comment #7
danthewolfe commented#5 worked for me after editing/saving the affected nodes.
Comment #8
brightboldThanks! Patch in #5 solved my problem (also after editing/saving affected nodes.)
Comment #9
jdanthinne commented#5 Solved my problem as well.
Comment #10
joetsuihk commented#5 do not apply to latest dev
Comment #11
joetsuihk commentedcommited, thanks all!
Comment #12
dropfen commentedI found a little bug in the last commit on Line 415, so if $entity->language is defined, and Image Field is 'undefined'. New values will never set.
So here is the Patch. Thx for this Module
dropfen
Comment #13
joetsuihk commentedRe #12 Thanks for reporting back!
there is a bug on
$langneed the key, not the object itself.From the description you had, please try the attached patch for a different approach.
Also, not to being picky, but issue number is suggested to be part of file name, so it will be easier to trace ;-)
Comment #14
dropfen commentedThank you for your reply,
but I think you don't understood my problem.
So, I'll explain it more precise.
In my case the $node/$entity->language is 'de' // German
But the image field don't have an defined language so the key in my image_field is 'und'. And this is why I need to check the field language:
I hope you understand me, and sorry for my bad english
dropfen
Comment #15
joetsuihk commentedwill return object, which will be error.
The patch #13 do not work on your machine?
Joe
Comment #16
dropfen commentedOh Yes. My false.
in my patch it should be:
Of course I need the value not the field array.. Thank you.
dropfen
Sorry, but yes the patch will not work.
Comment #17
dropfen commentedNew patch attached, and look the Issue number is added to the filename :)
Comment #18
joetsuihk commentedthx @dropfen!
http://drupalcode.org/project/imagefield_crop.git/commit/3e680ca
I will likely prepare a 7.x-1.1-rc1 shortly this week. 1.0 is too broke
Comment #19
dropfen commentedThx to you, this is my first patch landed into contrib, if it'll :)