Wouldn't it be incredibly cool if those actions of an imagecache preset which are sorted after a Javascript crop action are applied only after I press the "Create Crop" button?
That's somehow the bahaviour I expected when creating my preset.

In case you want to create a small square thumbnail it would be much easier to just select the crop area with a resizable toolbox (which ideally maintains ratio) and after clicking "Create Crop" a "Scale and Crop" reduces the cropped area to the desired size.

CommentFileSizeAuthor
#2 imagecrop_discard_actions.patch441 bytesmindgame

Comments

swentel’s picture

Status: Active » Fixed

Well all actions after a javascript crop action are blocked when using the toolbox normally, unless I missed out somewhere - or not understanding your question correctly. You can make the box resizable, but ratio support will be available for the D6 version first, I might backport it once a D6 version is out.

mindgame’s picture

Version: 5.x-1.1 » 5.x-1.x-dev
Component: User interface » PHP
Category: feature » bug
StatusFileSize
new441 bytes

Yes, I also expected the actions after javascript_crop to be blocked, that's what I meant.
But actually they weren't.

I have a test preset with these actions:
1. Javascript crop (width: 100, height: 100, xoffset: center, yoffset: center, resizable: 1)
2. Scale And Crop (width: 100, height: 100)

When I go to choose a new cropping area in the toolbox the original image always appeares scaled-and-cropped to 100x100.

Even an update from 5.x-1.1 to the 5.x-1.x-dev (2008-Sep-26) didn't help.

Maybe really something is missed out, because in the imagecrop.module, function create_image_object(), there's a break when a javascript_crop action is found, but the remaining actions are not unset. The attached patch made it work as I think it should? At least I'm very happy now with the module! :)

swentel’s picture

Hmm, it looks you are completely right about this, nice catch! I'll commit this somewhere tonight normally!

swentel’s picture

Status: Fixed » Needs review

Just changing status so I don't forget to look at this tonight / tomorrow :)

swentel’s picture

Status: Needs review » Fixed

I commited the fix to Drupal 5 branch, implemented it with a few changes (cf http://drupal.org/cvs?commit=143570). Thanks for this report!

mindgame’s picture

Thanks for this module, but now I migrated to D6 and I'm missing it!

swentel’s picture

Status: Fixed » Closed (fixed)

I'll be working on that this friday to start the first branch, I'll also roll out another release for D5