Announcement

#1 2020-06-14 18:48:10

polochon777
Member
2020-06-14
5

Corrupted file when downloading

Hello,

It seems that my photos are corrupted when I try to download them.
I can: browse the photos in the gallery, display the pictures in the original size, and save the file through the web navigator (right click, save AS)
But, when I click on the piwigo download button:
- sometimes I have an error like "/tmp/mozillaXXXXXXX.jpeg.part can't be saved because the source file can't be read" and I can't download anything
- or sometimes I can download the file but I can't open it: the image reader claims that the file is corrupted.

So I think my database is NOT corrupted, but there is an issue during the download.

If I compare both files (saved through firefox VS downloaded via piwigo), the sizes are equal but the checksum aren't.
So I've lokked into the files and t seems than an extra byte is added at the beginning of the corrupt file.
Here is the right file hexa dump:
hexdump -C -n 16 /home/pol/Téléchargements/20200614112716-0ea8b261.jpg
00000000  ff d8 ff e1 0c 2c 45 78  69 66 00 00 49 49 2a 00  |.....,Exif..II*.|

And here the corrupted file:
hexdump -C -n 16 /home/pol/Téléchargements/20200614_100655-01.jpg
00000000  0a ff d8 ff e1 0c 2c 45  78 69 66 00 00 49 49 2a  |......,Exif..II*|

There is an extra "0A" byte on the corrupted version at 0000 address. At the end of the corrupted file, the last byte is missing.

The issue seems similar to this one: https://piwigo.org/forum/viewtopic.php?id=25681
But I've checked the extra white spaces in my config.inc.php and found nothing.
I've also checked with google and the forum but nothing to.

I've added this at the end of my config file but still no logs:
// ws_enable_log : Activer les logs pour les web services
$conf['ws_enable_log'] = true;

// ws_log_filepath : emplacement du fichier de log
$conf['ws_log_filepath'] = '/tmp/piwigo_ws.log';

Any idea are welcome, I don't know where to search!

Thanks
Polochon



Piwigo version: 2.10.2
PHP version: .0.33-29+0~20200514.36+debian9~1.gbp126f6f
MySQL version: 5.5.5-10.1.44-MariaDB-0+deb9u1 [2020-06-14 17:31:03]
Piwigo URL: private gallery
Plugins: videoJS added recently
Installed via YUNOHOST

Offline

 

#2 2020-06-14 20:01:00

polochon777
Member
2020-06-14
5

Re: Corrupted file when downloading

To be 100% sure thath my database is not corrupted, I've checked the file on the server:
hexdump -C -n 16 ./upload/2020/06/14/20200614112716-0ea8b261.jpg
00000000  ff d8 ff e1 0c 2c 45 78  69 66 00 00 49 49 2a 00  |.....,Exif..II*.|

It is the same dump that my "firefox save as" file, and the md5sum in the database (checked with phpmyadmin) is the same that than the OK file.

So there is "only" an issue when the file is downloaded.

----------------------------------------------------

edit:

I've just reinstalled piwigo in a fresh yunohost server in a virtual machine without configuration / modification, Added a photo, then download it. Same result, file is corrupt!
WOW!!!!!! Please, can anyone try to download a picture to see if the issue is easily reproductible?

Thanks

Last edited by polochon777 (2020-06-14 20:18:26)

Offline

 

#3 2020-06-15 01:11:09

erAck
Only trying to help
2015-09-06
2021

Re: Corrupted file when downloading

What picture from where?
Downloading one from my own gallery works..


Running Piwigo at https://erack.net/gallery/

Offline

 

#4 2020-06-15 09:37:52

polochon777
Member
2020-06-14
5

Re: Corrupted file when downloading

What picture from where?

Any picture from your gallery.

That's what you did, and it is working for you. Do you use the "download button"?

The very strange point here is that with a fresh install of piwigo I have this issue. Either it is a huge bug and in this case all piwigo users should have it, either it is more subtil and dependant of a specific context on the server.
I will try to reinstall piwigo without yunohost to see...

Any other idea is welcome!

Offline

 

#5 2020-06-15 11:41:01

polochon777
Member
2020-06-14
5

Re: Corrupted file when downloading

I think I've found the issue, which is already open here: [Github] ldap_login issue #30
Removing the extra trailings end solved the issue.

@erArck, do you have the Ldap_login plugin installed?


edit: althought there is extra CRLF in the ldap plugin, the root cause is described here: https://github.com/Piwigo/Piwigo/pull/643
The piwigo download procedure is not protected against these buffers issues. But this piwigo isse is closed and the proposed fix never integrated?!

Last edited by polochon777 (2020-06-15 12:59:30)

Offline

 

#6 2020-06-15 13:31:33

erAck
Only trying to help
2015-09-06
2021

Re: Corrupted file when downloading

Yes with download button. No ldap_login plugin here. Nice find of GitHub issue and pull request, so at least some cause is known.


Running Piwigo at https://erack.net/gallery/

Offline

 

#7 2021-01-28 23:30:15

hosh
Member
2021-01-28
9

Re: Corrupted file when downloading

I also seem to have this issue after updating to 11.1.0.

Photos downloaded in original size are corrupt and won't open in a photo viewer.
Photos downloaded at other sizes are OK.

I have the following plugins active:
Admin Tools, Batch Downloader, Download by Size, GThumb+, Language Switch, Personal Favicon, Simple Copyright, Take a Tour of your Piwigo, Virtualize.

I have checked the files action.php and admin.php for extra instances of ?> and there were none. There was an extra line after the ?> which i removed.

Example photo at http://photos.wasns.org/picture.php?/7355/category/873


Environment
Piwigo 11.1.0 Check for upgrade
Operating system: Linux
PHP: 5.6.38 (Show info) [2021-01-28 16:13:10]
MySQL: 5.6.41-84.1 [2021-01-28 16:13:10]
Graphics Library: ImageMagick 6.7.2-7

Offline

 

#8 2021-01-29 02:02:32

erAck
Only trying to help
2015-09-06
2021

Offline

 

#9 2021-01-29 07:01:30

hosh
Member
2021-01-28
9

Re: Corrupted file when downloading

thanks erAck.  I have replied there, with another question.

Offline

 

#10 2021-09-19 23:16:00

Netcie
Member
2017-11-20
19

Re: Corrupted file when downloading

Due to capacity issues I was just recently able to fix stuff on the Ldap_Login extension.
See https://github.com/Kipjr/ldap_login/tree/dev

Offline

 

#11 2021-09-20 08:56:52

polochon777
Member
2020-06-14
5

Re: Corrupted file when downloading

Great!

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact