It appears that this module (and other manual image cropping modules like it) are incompatible with the FE Paths (http://www.drupal.org/project/fe_paths) module. The reason for this, I believe, is that the FE Paths module uses drupal_register_shutdown_function()
to delay the actual processing of the uploaded files. Here's the chain of events as I currently understand it:
- A user uploads a file (original location).
- FE Paths sets up the move/rename, then uses
drupal_register_shutdown_function()
to "queue" the change. - Imagefield Crop queries the DB for the uploaded file's current (original) name and location.
- Right before the page generation is complete, Drupal calls all of the functions registered with
drupal_register_shutdown_function()
, this results in the image being moved/renamed. - The page is rendered to the user, but since the uploaded image is now in a new location, the Imagefield Crop widget ends up displaying missing (broken) images.
The reason that FE Paths uses drupal_register_shutdown_function()
is a sound one (http://drupal.org/node/1515728), but I'll add an comment to the issue to request some guidance. For the record, the Filefield Paths module (http://www.drupal.org/project/filefield_paths) does not use drupal_register_shutdown_function()
; as far as I can tell it uses the BatchAPI to do something similar. In my case, Filefield Paths won't work for me for another, unrelated, reason.
I've spent a couple of hours trying to figure out how to get access to the uploaded files new name/location in an attempt to use that information in the _imagefield_crop_file_to_crop()
function.
Thoughts? Suggestions?
Thanks,
-mike