Page 1 of 1

Corrupt download of jpegs

Posted: 05 Nov 2013, 15:46
by willd
I have been asked to look at a site using Joomla 1.5.22 / PHP 5.2.14 /Phocadownload 1.3.8. When the end user downloads a jpeg from the site the saved jpeg seems to be corrupt or incomplete. In Windows Picture Viewer it says 'no preview available', in Paint it says 'this is not a valid bitmap file'. You can open the resulting jpeg in Photoshop with warnings that it is incomplete or corrupt. An example of this can be found at this URL: londonlibrary.co.uk/index.php?/historicimages.html
There are very few changes being made on this server and the person who updates the website says that it worked a few months ago. I have tried replacing the files with known good ones, downloading them directly and opening them on the server; the files themselves seem to be OK. I have loaded this configuration onto another test server with the same result. I have tried disabling other modules one at a time to see if there is anything interfering with phocadownload, but can't really see what is happening.
Do you have any ideas on what this might be or suggestions on how to troubleshoot?
Thanks for any help as I have run out of ideas on what to try.

Re: Corrupt download of jpegs

Posted: 05 Nov 2013, 18:30
by Jan
Hi, hmm, really no idea what can be wrong there, Phoca Download does not modify any files, it only gives information from sever to browser - so the download is working between server and the browser. Really no idea what can cause such error. Did you check the server settings (e.g. some limits, etc.) :idea:

The interesting thing:

I have download the image, e.g. 1935 album 004.jpg, opened in text editor to view the source and removed this string:

"Resource id #145"

After removing this string and saving it, the image could be displayed. This seems like some part of your system ask for some sql data - the string: "Resource id #145" is an output from database (the name of output items) ... so there seems to be something on your server (e.g. some system plugin, etc. which prints this resource name and such is printed into image source code, such then makes the image not displaying. But what does it do, really no idea. :idea: ... testing the 1.3.8 on 1.5 now with jpeg and get no modified image :idea:

Jan

Re: Corrupt download of jpegs

Posted: 08 Nov 2013, 15:22
by willd
Jan,
I hadn't noticed the Resourceid being appended to images, so thanks for pointing this out. I have been systematically turning off modules and plugins in Joomla admin to see if I can spot what is causing this, but with no success so far. As you say it must be something adding this to the image, but what it is and how to find it has really stumped me.
Thanks for your help anyway.

Will

Re: Corrupt download of jpegs

Posted: 12 Nov 2013, 21:06
by Jan
Ok, yes, for me it is confusing too, really no idea which part can add such string there :idea: :-( ... never seen such behaviour.

Jan

Re: Corrupt download of jpegs

Posted: 18 Nov 2013, 22:39
by plalemand
Hi

I have a similar problem with zip files. I'm using joomla 1.7 and the last version of phocadownload 2.1.9. I change the server few weeks ago (before this change, everything was perfect).

Now I have some zip file on my site and 2 of them become corrupted when downloaded via phocadownload (it miss few bytes at the end). With a direct link, files are well downloaded.

How can it be !
Thanks for you support.
Pat

Re: Corrupt download of jpegs

Posted: 18 Nov 2013, 23:45
by plalemand
I set the "direct download" to yes and it works.
Then what is the difference and why this parameter is not set to yes by default.
Thanks

Re: Corrupt download of jpegs

Posted: 19 Nov 2013, 17:50
by Jan
The difference is, by not direct link, you can count the statistics - by direct link no.

Jan

Re: Corrupt download of jpegs

Posted: 24 May 2016, 10:49
by webbmary
I have the same error at this site: http://www.skipperfurniture.dk.

They are using Joomla 2.5 and Falang. Danish is the default language. For image gallery and downloading pictures they are using PhocaGalley. At the default language is doesn't work to download the large picture: e.g. http://www.skipperfurniture.dk/index.ph ... 40&lang=da BUT THE STRANGE THING IS THAT ITS WORKING AT THE LANGUAGE MANAGE BY FALANG: e.g. http://www.skipperfurniture.dk/index.ph ... 40&lang=en (click on the green arrow).

Re: Corrupt download of jpegs

Posted: 29 May 2016, 18:06
by Jan
Hi, yes, this is really interesting, you can download both and you get files with the same size, but the first cannot be open, when you edit it in text editor, and you remove the first row enter (there is first row empty), then it can be displayed.

So it seems like when downloading, the server somehow renders something into the file - but only new row, no characters, etc.

Are you able to enable php error reporting, or see errorLog -to see if there is no php error message rendered.

In case, error reporting is ON, and errors are displayed on the site, the image should include this error message in first row and such can be read. :idea:
https://www.phoca.cz/documents/16-joomla ... rs-on-site
Jan