Posted by FiNeX on July 30, 2007 at 8:57am
| Project: | Upload previews |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
Hi! If you have the "attachments" active for the image content type and the upload previews is active, when you access to an image upload previews set some warnings (one for the original image, one for the preview and one for the thumbnail).
I've fixed the module modifying the function:
upload_preview_upload_preview($file)
Substituting the line:
if (strpos($file->filemime, 'image/') === 0 ) {with:
if (strpos($file->filemime, 'image/') === 0 && ( substr($file->filepath, 0 , 7) != variable_get('image_default_path', 'images') . "/" ) ) {In my Drupal installation the images are stored on the "images" subdirectory.
In this way the image attachment still have the previews, but the images doesn't throws errors.
| Attachment | Size |
|---|---|
| upload_preview.module_1.patch | 688 bytes |
Comments
#1
Patch update.
Changes:
1) I've fixed the image file path check
2) Now the previews work with the images handled by the image node.
Apply the patch to the file:
upload_preview.module,v 1.10 2007/06/17 14:04:29
#2
Patch cleanup.
#3
Actually the patch doesn't filter the node testing if the node type is "image", should it do that?
#4
It should check if node type is image. I should only check if the attachment is an image. There is a slight diff. Need to review for inclusion in the module.
Thanks
Robert
#5
This patch no longer works with the current version of upload preview. Any chance of an update?
Please!!!
#6
Need to incorporate in a check for the image module. Just need to add checks to make sure the image module is installed before making the changes.
Thanks
Robert