Closed (fixed)
Project:
Imagecache Token
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Sep 2014 at 20:15 UTC
Updated:
21 Aug 2015 at 15:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
thirdender commentedComment #2
doubouilIt's normal, code use the file object value, which are the original image width and height.
Here's my version where I generate the derivative image and then use get_image_info() to grab the generated image width and height, as expected. I Also added mimetype value in token values since last version of Metatag Open Graph accepts them, and get_image_info() returns it so might as well use it ! Also supports imagecrop module.
Feel free to reuse/make a patch of it !
Edit : You need to edit Line 111 to " if ($images_style_sizes[$styled_uri]["width"] && $images_style_sizes[$styled_uri]["height"]) {", I used getimagesize() before get_image_info() )
Comment #3
damienmckennaHere's a patch based upon doubouil's code.
Comment #4
damienmckennaNeeds to be rerolled.
Comment #5
damienmckennaRerolled, and I added some comments.
Comment #6
damienmckennaComment #7
damienmckennaAfter some testing, this appears to work reasonably.
Comment #8
damienmckennaCommitted.
Comment #10
doubouilI just updated with rc1 my production environment where I initially made the patch, still works as expected (metatags returns imagecroped width and height). I'd say this issue is cleared for 1.0.