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.

AttachmentSize
upload_preview.module_1.patch688 bytes

#1

FiNeX - July 30, 2007 - 10:39
Status:active» needs review

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

AttachmentSize
upload_preview.module_2.patch 1.71 KB

#2

FiNeX - July 30, 2007 - 10:42

Patch cleanup.

AttachmentSize
upload_preview.module_3.patch 1.66 KB

#3

FiNeX - August 2, 2007 - 17:24
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?

#4

rmiddle - October 9, 2008 - 04:01

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

plan9 - March 16, 2009 - 20:32

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

 
 

Drupal is a registered trademark of Dries Buytaert.