Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
b00mtastic
Topic Author
Posts: 8
Joined: 27 Feb 2016, 23:29

get imagesize failed

22 May 2016, 10:29

Hello,

I'm trying to upload some JPG pictures to my site through the panel. I am getting an error once the upload completes that states "get imagesize failed (source file may not be an image)" and then the link to the file. The files are coming from my Galaxy S7 and I am running the latest version of Imagevue (X3 v0.18.1). It seems to only affect the creation of thumbnails, as most files will open when you click on them. Some won't however. I have found that using FTP also gives the same results. Have you seen this error before? Thanks in advance.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13997
Joined: 30 Sep 2006, 03:37

Re: get imagesize failed

22 May 2016, 12:45

Haven't heard of this before, but it clearly sounds like something with the images. If I can get a link to images that "don't open", I can see what's up with the images. Sounds like they may be corrupted somehow.
 
User avatar
b00mtastic
Topic Author
Posts: 8
Joined: 27 Feb 2016, 23:29

Re: get imagesize failed

22 May 2016, 13:00

http://www.boomtastic.com/gallery/pictu ... 1987Fiero/

The first 2 pictures were existing ones, but the rest are new. You'll immediately see that the thumbnails aren't correct, however if you click on a couple of pictures they will actually work. Another example is this one in which all of the pictures are new and yet some work and some don't:

http://www.boomtastic.com/gallery/pictu ... IndyFiero/

All pictures were taken on the same day, at the same time, with the same phone.
 
User avatar
b00mtastic
Topic Author
Posts: 8
Joined: 27 Feb 2016, 23:29

Re: get imagesize failed

22 May 2016, 13:04

Here's the error when trying to upload through the panel.
Attachments
error.PNG
Error Log
error.PNG (38.23 KiB) Viewed 2658 times
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13997
Joined: 30 Sep 2006, 03:37

Re: get imagesize failed

22 May 2016, 15:27

The original images can be viewed, they are clearly images ... However, they seem to be missing crucial data that PHP relies on for any image function (ex resizing).

I downloaded an image, and ran it through a basic PHP getImageSize() call:
Image

When running any other image, it returns this:
Image

It is pretty safe to say that the image resize function fails because it can't get any data from the images. The code for testing is simple:
Code
<?php
$filename = '03.jpg';
$size = getimagesize($filename, $info);
var_dump($filename);
var_dump($size);
?>
Seems like the original images are displaying properly, so can't say anything about that ... It seems they have corrupted data, or at least something that PHP doesn't like. I will guess it's related to one of the following:

1) Something with the server, that corrupts while being uploaded. Do you have the original image source for one of the images that you could send?

2) ... or the images are simply corrupted internally to the degree that PHP can't read- and process them.

I could check from an original source image.
 
User avatar
b00mtastic
Topic Author
Posts: 8
Joined: 27 Feb 2016, 23:29

Re: get imagesize failed

22 May 2016, 18:43

Wow, that's definitely odd. I do have the source files but due to size they don't like the File Attachment option here, so I made a raw directory on my webserver and dumped a few in for you to review:

http://www.boomtastic.com/karl
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13997
Joined: 30 Sep 2006, 03:37

Re: get imagesize failed

23 May 2016, 02:11

I did some tests, and the same results apply for the original images. They simply output false for the native PHP getimagesize() function.

I tried to STRIP the EXIF meta data from the image, which allowed it to work. The issue is therefore clearly related to the EXIF data stored in the image. Corrupted data, PHP shortcoming or whatnot I am not sure ...

I posted in stackoverflow to see if anyone has any suggestions:
http://stackoverflow.com/questions/3738 ... if-related

In the meantime, the solution is: If you strip the EXIF meta data from the images before upload, they will work. There are many tools that can do this. For Mac, I use a simple tool called ImageOptim ... For Windows, there are many:
http://luci.criosweb.ro/riot/
http://www.creativebloq.com/design/imag ... ls-1132865
http://enviragallery.com/9-best-free-im ... mpression/
 
User avatar
b00mtastic
Topic Author
Posts: 8
Joined: 27 Feb 2016, 23:29

Re: get imagesize failed

23 May 2016, 02:21

Thanks Karl. I'll reach out to Samsung as well, since this is a brand new Galaxy S7 Edge. I was using an S6 Edge before without any issues, so I will see if they changed anything (??) in the backend. Meanwhile I will work on stripping the EXIF data and hope that this is a temporary solution.