Thumbnail could not be copied

From TNG_Wiki
Jump to navigation Jump to search

When I add a photo to my site if I try and add a thumbnail, I get the following message:

The thumbnail file could not be copied to /home/yoursitename/genealogy/photos/thumb_photo_filename.jpg because the original file is too large or is not a valid image, or because the folder does not exist (check the Root Path) or does not have proper permissions (try chmod(777))..

I can add the same image without a thumb but not with one. The photos folder does have the correct permission, I have checked that.

The above problem was reported on the User2 list by Brian Lodge on 21 Nov 2009 11:59 am

Typical causes

Answer provided by Darrin on the User2 list on 21 Nov 2009 12:48 pm.

The error message gives 4 possibilities. We can rule out the folder not existing or having inadequate permissions, because we know you can upload the image without creating a thumbnail.

That leaves

  1. original file is too large, or
  2. original file is not a valid image.

You might think that because you can see it on the screen when you upload it without the thumbnail that #2 is ruled out, but there could still be something wrong with the file. You might try opening it in a photo editor and resaving it. If #2 is the problem, that will usually fix it. That said, #1 is usually the answer. Try downsizing the file first, then see if TNG can create a thumbnail for you.

The following was added here by Ken Roy.

If you specified the thumbnails prefix as thumbs/ indicating the thumbnails should be saved in the thumbs subfolder, then it is possible to get the error indicated if the thumbs subfolder does not exist. In this case the message would show

The thumbnail file could not be copied to /home/yoursitename/genealogy/test/thumbs/filename.jpg because the original file is too large or is not a valid image, or because the folder does not exist (check the Root Path) or does not have proper permissions (try chmod(777)).

Recommended actions

If the error is due to a thumbs/ subfolder not existing, then create the thumbs subfolder before attempting to create the thumbnail.

If the error is due to the original file being too large, you should reduce the size of the file using IrfanView or some other photo utility.

Note that if the file is excessively large, you might not even get that message but rather will get a blank page after doing the media record save, because the GD Library ran out of storage and cannot even return an error message.

___ Found out that on my configuration: TNG 12.1 on Synology DSM 6.2.1 with PHP 7.2, the upload_max_filesize parameter in php.ini originated the error. If other solutions don't work, check your PHP configuration. Important to note is that in my case the PHP.ini should allow for 32M files to be uploaded, but a 3.5M file was only uploaded when I changed the parameter to 64M. If a file cannot be uploaded the thumbnail error will occur because the original file cannot be found.

Related Links

Blank Pages