Hi
At this site http://www.skipperfurniture.dk/index.ph ... 40&lang=da, all of a sudden, the link of downloading the orginal images dosen't work anymore (Error mess: "Can not open this picture because the file is damaged, incorrect or too large."). The thumbnail is working. Anyone who please can give me any tips?
It's in a Joomla 2.5 site and we have Phoca Gallery 3.2.8
Download picture Phoca Gallery
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Download picture Phoca Gallery
Hi, check the original image on the server - the download goes to original image. 
Check if it is stored on server (not deleted), if the image is not damaged, etc.
Jan
Check if it is stored on server (not deleted), if the image is not damaged, etc.
Jan
If you find Phoca extensions useful, please support the project
-
webbmary
- Phoca Newbie

- Posts: 7
- Joined: 22 Apr 2014, 11:37
Re: Download picture Phoca Gallery
Hi,
I have checked that, for example the product from URL abowe.... the original picture http://www.skipperfurniture.dk/images/p ... ofa-01.jpg works fine.
But NONE downloads work of any products =(
I have checked that, for example the product from URL abowe.... the original picture http://www.skipperfurniture.dk/images/p ... ofa-01.jpg works fine.
But NONE downloads work of any products =(
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Download picture Phoca Gallery
Hi, I see, I have downloaded both images, one per download button, second directly - both are the same, both have the same size, but the one downloaded by the download button includes on first row an empty space, when I remove it, the image can be displayed correctly.
So seems like the server, before it gives the image for download, write something as output which is then stored in the image first row and which causes the problem with displaying the image.
In this code, there is a download - setting headers for download:
administrator\components\com_phocagallery\libraries\phocagallery\file\filedownload.php
You can see that there is a function: ob_end_clean(); (line 71, 93) - this should clear all output of the server, but seems something on your server writes empty space after this clean
The headers can be changes directly for the server needs, but this just needs to test every possible combination 
Jan
So seems like the server, before it gives the image for download, write something as output which is then stored in the image first row and which causes the problem with displaying the image.
In this code, there is a download - setting headers for download:
administrator\components\com_phocagallery\libraries\phocagallery\file\filedownload.php
You can see that there is a function: ob_end_clean(); (line 71, 93) - this should clear all output of the server, but seems something on your server writes empty space after this clean
Jan
If you find Phoca extensions useful, please support the project
-
webbmary
- Phoca Newbie

- Posts: 7
- Joined: 22 Apr 2014, 11:37
Re: Download picture Phoca Gallery
Hi Jan and thanks for your answer but I don't know what to do? I'm not sure of what you mean with: "The headers can be changes directly for the server needs, but this just needs to test every possible combination". What can I test to do?
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Download picture Phoca Gallery
Hi, there is a specific feature - to be able to download a file and not to display it in browser, specific headers need to be sent by the server. In Phoca Gallery, the common headers techniques are used. So when we need that the server sends the file (image) to users for download, we need to send headers to user's browser. They are called http headers. It can happen, that such header information can be wrongly set by the server (e.g. some information is rendered and it will damage the information of downloaded file). So this is more a question on webhosting provider, if there is something which writes something to the headers and damage it. So what needs to be done:
- The problematic part needs to be found and if e.g. the headers are not working for the server, other header information needs to be set or the error needs to be found
Unfortunately, the only thing I have detected, is, that something on your server writes empty space to the header - so the image file will be corrupted. But this is all I can detect and unfortunately I don't have any other tools how to detect what can be wrong there
and which part makes the empty space 
Jan
- The problematic part needs to be found and if e.g. the headers are not working for the server, other header information needs to be set or the error needs to be found
Unfortunately, the only thing I have detected, is, that something on your server writes empty space to the header - so the image file will be corrupted. But this is all I can detect and unfortunately I don't have any other tools how to detect what can be wrong there
Jan
If you find Phoca extensions useful, please support the project
-
webbmary
- Phoca Newbie

- Posts: 7
- Joined: 22 Apr 2014, 11:37
Re: Download picture Phoca Gallery
Hi Jan,
I tried to move the site to an other server and it dosen't work there either. http://kalbynet3.kalbynet.se/~skipper/i ... 35&lang=sv
I tried to move the site to an other server and it dosen't work there either. http://kalbynet3.kalbynet.se/~skipper/i ... 35&lang=sv
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Download picture Phoca Gallery
Hi, testing now and I get the same error - so this can mean, the server has the same configuration like the other (I for know really have no other and better explanation - Phoca Gallery is working since 2007 on many thousands of sites, so I don't expect there is something problematic when downloading the file - the script is standard common script for download). But it seems like something, I really don't know writes something before the download happens - try to, if possible, install pure Joomla! CMS with gallery only - disable all possible plugins, modules and test it with standard template - if this will work, then try to enable other parts of system to know, what can be wrong there 
Jan
Jan
If you find Phoca extensions useful, please support the project
-
webbmary
- Phoca Newbie

- Posts: 7
- Joined: 22 Apr 2014, 11:37
Re: Download picture Phoca Gallery
Hi again Jan and thanks for your answer. I FINALLY found the error. An old version of extstore.com/joomla-extensions/plugins/scroll-to-top. When I installed the latest version it works! 
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Download picture Phoca Gallery
Ok
If you find Phoca extensions useful, please support the project