upload previews conflicts
FiNeX - July 30, 2007 - 08:57
| Project: | Upload previews |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
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 |

#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!!!