When looking up the desired cropping data, manual crop joins the manualcrop and file_managed tables to find the data, based on an URI. This is fine as long as the URI has a local public:// scheme but when using other solutions, like the storage API for instance, the image effects are called with a tempoary:// URI as the source.

To be able to get the correct file URI, this patch adds a check to the manualcrop_load_crop_selection() function.

IMPORTANT! This currently requires a patch for the Storage API to work. http://drupal.org/node/1943124#comment-7178906

Comments

esbenvb’s picture

Here's the patch.

Remember to do the right attributions when porting patches, as mentioned on http://drupal.org/user/989064

matthijs’s picture

Assigned: Unassigned » matthijs

This looks nice, I'll certainly push if the StorageAPI patch gets committed!

Matthijs

matthijs’s picture

Project: Manual Crop (old) » Manual Crop
Version: 7.x-1.x-dev » 7.x-1.4
matthijs’s picture

Issue summary: View changes

Added link to storage API patch

kristougher’s picture

I was not able to apply the patch to latest dev revision. This is the exact same code patched from 1.x-dev

josh.fabean’s picture

Can confirm patch in comment #4 works for me and this fix still works today (May 12, 2015) on latest version of Manual Crop and StorageAPI. Is there any reason this hasn't been committed to latest dev yet?

tessa bakker’s picture

Version: 7.x-1.4 » 7.x-1.x-dev

@josh.fabean: The patch for StorageAPI #1943124: StorageTempURIs should support resolving back to the original URI, especially for image style generation etc. is required for this patch, so review the first one and when it's applied to StorageAPI, this one can be added to Manual Crop.

ckng’s picture

Reroll for dev.

ckng’s picture

Previous one was a bad patch. Try this.