Closed (fixed)
Project:
Image javascript crop
Version:
7.x-1.0-rc3
Component:
PHP
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Dec 2011 at 18:27 UTC
Updated:
21 Feb 2012 at 08:30 UTC
Hey,
I just wanted to point out a possible issue between the media update and JS imagecrop modules.
I was wondering if JS imagecrop detects a file change & destroy it's linked crops accordingly?
Here's the link to the other module i'm talking about. It would theorically let me update the media file, but what about it's crops?
http://drupal.org/project/media_update
Comments
Comment #1
nils.destoop commentedDownloaded the module, but it's not working on media 2.x. I'll wait some time, till it also supports that version.
I did a quick look at the code, and it looks like it creates a new fid. If this is the case, then the linked crop will be destroyed.
Comment #2
Marc-Antoine commentedI know it's not yet ready, I just wanted to prevent a bug.
thank you for your quick answer.
Comment #3
Marc-Antoine commentedHere's an update on this subject since media update now has a functional version for the 1.x branch of media
Using:
media update 7.x-1.x-dev
media 7.x-1.x-dev
Image javascript crop 7.x-1.0-rc3
The current behavior is the following:
The ancient crops are kept and applied to the new picture, causing unwanted display of the new picture (could be a black square if the original picture is larger than the new one).
The correct behavior would be to erase the existing crops if the original image file is updated.
Here's the media update issue: http://drupal.org/node/1380424
Comment #4
Marc-Antoine commentedChanging the issue status
Comment #5
shawn_smiley commentedI've added a new hook implementation to the media_update module that allows the Javascript Crop module to be notified when a media update occurs. You should be able to key off of this to perform any cleanup or adjustments needed.
Let me know if you need any additional information from the hook call.
Here is the hook code (also in the api file of the media_update module):
Comment #6
nils.destoop commentedThis hook is now implemented