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.

Comments

finex’s picture

Status: Active » Needs review
StatusFileSize
new1.71 KB

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

finex’s picture

StatusFileSize
new1.66 KB

Patch cleanup.

finex’s picture

Title: uploade previews conflicts » upload previews conflicts

Actually the patch doesn't filter the node testing if the node type is "image", should it do that?

rmiddle’s picture

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

plan9’s picture

This patch no longer works with the current version of upload preview. Any chance of an update?
Please!!!

rmiddle’s picture

Status: Needs review » Needs work

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

pomliane’s picture

Status: Needs work » Closed (won't fix)

This version of Upload previews is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.