Closed (fixed)
Project:
EPSA Crop - Image Cropping
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Nov 2011 at 09:36 UTC
Updated:
17 Mar 2014 at 21:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
lukusI've found that altering
function epsacrop_crop_image_form($data)after line 264 seems to do the trick ..I added ..
.. after the part that loads the standard crop form data.
Not sure how many unintended consequences this might introduce yet though ..
Luke
Comment #2
lukusI've also added some validation:
The code above becomes ..
And the following functions are added ...
Comment #3
lukusHere's a patch .. not certain that I've done this correctly - so any advice appreciated.
Comment #4
yvmarques commentedHi,
Thanks for your contribution, its appreciate a lot.
This works for you ? I mean, even in the end-user (when you've to crop a image) the width or height (depends on the context) are free if you don't set width or height ?
Thanks,
-- Yvan
Comment #5
lukusHi Yvan
Thanks for the module - it's really useful :)
This works for me - but I'm a little bit worried that I might have disregarded something important.
Because only one value has been set - the initial view isn't very pleasing (before the crop has been defined) - but for my purposes it seems okay.
Maybe someone else could test and confirm?
Luke
Comment #6
Levdbas commentedfollowing
Comment #7
lukusBecause there's potentially only one dimension stored for the image crop, when it comes to resizing the cropped image - we'll hit a problem as image_resize() requires two dimensions.
To deal with this eventuality, I'd propose changing image_resize() to image_scale on line 352 of epsacrop.module.
Luke
Comment #8
lukusAny update on whether this could be included?
Comment #9
yvmarques commentedHi,
I haven't enough spare time to try it deeper, but if it's working I will include it.
Also, can you create a new patch from the last -dev with the change your proposed in #7 it will help me a lot and I can commit it sooner.
Thanks,
-- Yvan
Comment #10
TelFiRE commentedNever happened or what?
Comment #11
cwithout commentedTested out the patch with the suggested change from #7. Worked well.
Here's an updated patch.
Comment #12
garbo commentedI just applied the patch from #11 and can confirm that it works.
I just want to mention that if you only use one value (e.g. the width) that you probably should check the checkbox for "Ignore if not manually set". In that case the image is being scaled to the set width without cropping.
It's a very handy addition to the already good EPSA crop! (please see if it can be committed)
Comment #13
yvmarques commentedComment #15
lukusHi - was this ever committed?
Comment #16
yvmarques commentedHi,
Yes it was committed in August 9.
https://drupal.org/commitlog/commit/11912/8adb85fcd7be860fb3485003f834d9...
Regards,
-- Yvan
Comment #17
lukusThanks very much :)