When I set an additional image size 'large' in addition to the default 'thumbnail' and 'preview' I get an error message after inserting an image. The error says:

the selected file <em>/home/peter_n/public_html/drupaltest/files</em> could not be copied

In addition to the error message, a file of 0 bytes is created in my files/images directory called files. If I try and insert a new image, the same message appears, but the new file is called files_0.

If I use only the default thumbnail and profile, there is no error message.

I'm using Drupal 4.7.0 beta 3 and Image module from cvs.

CommentFileSizeAuthor
#2 image.module_12.patch1.05 KByched

Comments

grohk’s picture

Priority: Minor » Normal

I am experiencing this problem even when the extra size is not set. It looks to me like the image module is unable to move the images out of the temp folder and instead creates new images with _0 appended to the end of the filename. This is more than a minor bug since a warning is displayed on every upload, and am setting it as such.

yched’s picture

Status: Active » Needs review
StatusFileSize
new1.05 KB

This is because the sizes stored in the 'image_sizes' variable include the lines that are left blank in the 'sizes' form of the image settings page.

_image_get_sizes currently retrives the content of this variable 'as is', thus including dumb "empty" sizes (no label, no diemnsions...)

This patch modifies _image_get_sizes so that it filters the 'image_sizes' variable and returns only the valid sizes.

NB : There is a "ready to be commited" patch here, involving the exact same lines,
dealing with images.module not functionning with locale.

veelo’s picture

This patch seems to work for me.

Bastiaan.

grohk’s picture

Works for me too +1

peter_n’s picture

and me too.

walkah’s picture

Status: Needs review » Fixed

committed thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)