I am attempting to add an imagefield_crop field to my advanced user profiles. I can add a normal imagefield and it behaves perfectly, uploading and displaying fine when viewing or editing the advanced user profile.

However, as soon as I switch the field type to imagefield_crop, the image disappears. Instead, in profile edit, I am displayed:

jfield crop                        | Crop area:
                                   | 
(blank space                       | [remove button]
where image                        |
should be)                         |

In my Drupal logs, each time the page is viewed it registers:

Type: 	page not found
Location: http://sitename.com/system/files/picturename.jpg.crop_display.jpg
Referrer: http://uomeds.com/user/1/profile/uprofile

I have ImageMagick and GD2 enabled.

My only guess as to what might be wrong is perhaps it might be an Ajax issue. Upon initially building the site, I had 406 problems with Ajax view pagination, where next/previous page links provided by Ajax simply would not work. My web host added an allowance for "/views/ajax" to get it fixed:

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

Perhaps I need something similar here?

If maybe, I would prefer to figure out for sure first before bugging them. They have been quite accommodating, and I don't want to push my luck with erroneous requests.

Any info on what might be causing this and how to fix it would be very helpful.

Thanks.

Comments

yhager’s picture

Title: "Page not found" for images with imagefield_crop » Default to existing image if original is not found

The code should create this file - do you get any other error before/after? Is there an error in the status page?
Did you try to upload a new image to the crop interface too?

yhager’s picture

Also - does the file exist in the filesystem in the designated location?

uomeds’s picture

I think your second question explained what's happening, though I still don't know how to fix it.

According to my Drupal error logs and the red x image boxes in IE, it's attempting to load the pictures as:

http://sitename.com/system/files/picture.png.crop_display.jpg

but there is no /system/files/.. path on my website and I don't think there should be on a typical Drupal installation.

It should be saving and loading from:

http://sitename.com/sites/default/files/..

My File path: Path Setting in field management is left blank and inserting /sites/default/files/ causes it to tell me I can't specify that directory, as I presume it (should already be) the default.

Any ideas? What should I check next?

Thanks.

uomeds’s picture

My web host checked it out on their end at my request and replied:

We are getting some imagick error. It seems you are using ImageMagick as image manipulation php module. instead of ImageMagick, can you please try using GD and see how it goes?

We also would like to mention that imagefield crop widget requires following two modules too:

* jquery_interface (which by itself requires jquery_update).
* imagefield (since imagefield_crop is just an image widget module, not a field module)

Make sure that you have these modules enabled too.

Kindly try the above mentioned workarounds and do let us know if you require any further assistance.

yhager’s picture

nice helpful host you got yourself!

check the "file system" page under the admin settings ('admin/settings/file-system')

uomeds’s picture

Ya, I've had a lot of unpleasant hosts in the past (site5 was my last), but these guys I'm with now (canadianwebhosting.com) really are incredible. Best host I've ever had. (If I'm not allowed to mention hosts by name on here, feel free to edit it out or I will if needed.)

Regarding the file paths, I checked and 'File system path' is set to sites/default/files as I think it should be. Temporary directory is /tmp. Download method is set to "private".

So I think the default path is correct, but for some reason imagefield_crop is sending to /system/files instead. Not sure where that path is coming from as I have not seen it in any situation before now.

uomeds’s picture

Follow up: I just checked, and when the field type is set to ImageField rather than ImageField_crop, it uploads successfully to http://sitename.com/system/files/imagefield_thumbs/picture.png and displays normally.

So again I'm not sure why it's using that path, but it seems to work fine for Imagefield regardless. Imagefield_crop on the other hand continues to fail, with seemingly no picture uploaded, and no picture found to display.

yhager’s picture

Status: Active » Closed (duplicate)

This is an issue with private downloads. Can you set them to public? if not, issue #423652: Private file system can't see crop_display.jpg image. has a patch.
marking as duplicate.

uomeds’s picture

Status: Closed (duplicate) » Active

Oh, well that was simpler than I thought. Thanks.

It's working set to public. Remarkable plugin. Well worth the headache these past few days. I will try the private patch.

uomeds’s picture

Status: Active » Closed (duplicate)