Hello,
I've updated from 14.2 to 14.3 today and I'm facing problem with image downloads.
After the download, unable to open the image.
Best regards.
Piwigo 14.3.0 Dernière version ?
Installé le 25 Septembre 2018, il y a 5 ans 6 mois 2 semaines
Système d'exploitation: Linux
PHP: 8.0.23 (Montrer les informations) [2024-04-09 16:41:19]
MySQL: 5.5.5-10.3.32-MariaDB [2024-04-09 16:41:19]
Bibliothèque graphique: External ImageMagick 6.9.11-22
Taille du cache 1140.46 Mo à l'instant
Last edited by AnthonyS (2024-04-09 17:00:33)
Offline
Example URL?
Offline
Hi erAck
There's no public access to this.
Can I send you a downloaded image instead ?
But today I have no possibility to download. I have an error message instead :
URL :http://192.168.0.155/piwigo/action.php?id=55183&part=e&download
Warning: Cannot modify header information - headers already sent by (output started at /volume2/web/piwigo/action.php:225) in /volume2/web/piwigo/action.php on line 231
Warning: Cannot modify header information - headers already sent by (output started at /volume2/web/piwigo/action.php:225) in /volume2/web/piwigo/action.php on line 231
Warning: Cannot modify header information - headers already sent by (output started at /volume2/web/piwigo/action.php:225) in /volume2/web/piwigo/action.php on line 231
Warning: Cannot modify header information - headers already sent by (output started at /volume2/web/piwigo/action.php:225) in /volume2/web/piwigo/action.php on line 231
Warning: Cannot modify header information - headers already sent by (output started at /volume2/web/piwigo/action.php:225) in /volume2/web/piwigo/action.php on line 231
And it weird, becaus this error doesn't happen on every image I try to download. I can download other images (but still impossible to open then)
Last edited by AnthonyS (2024-04-10 10:32:02)
Offline
It's (only) a warning message, but that may also be the problem for downloaded images because some PHP message may have crept into the output and is prepended to the image header.
Either disable displaying deprecated and warning messages (because it effectively may break functionality of a page even if nothing else is broken), in local config
$conf['show_php_errors_on_frontend'] = false;
or fine tune message classes to display, see [Forum, post 183126 by erAck in topic 31852] Menubar tags issue after 12.2.0 upgrade, or better, log to file instead.
See [Forum, post 180778 by erAck in topic 31258] Error Message.
Offline
Thank you. I'll check this !
Offline
Well my problems are still here.
I put the log script you suggested to in my local/config/config.inc.php
A log file was created (it contains some php errors from Batch Downloader plugin, some errors when I sync new images), but the php warnings I mentioned before are still here (and just for one specific image, for now).
And the other images I download are still unopenable.
Last edited by AnthonyS (2024-04-10 14:41:16)
Offline
Please upload such failing image somewhere, e.g. gofile.io or postimages.org or imgur.com, and link here.
Offline
Here I put 2 images that fail
****************
Thanks again for your time
Last edited by ddtddt (2024-04-24 06:24:07)
Offline
Sorry, but the uploaded image is not an image. Checking for file type reveals "data" but not a .jpg image.
Offline
@OHappyDay I assure you it should be one, because when I directly download from the NAS where the images are stored, the image is good to see.
Here I added the one of the original one : *****
So piwigo seems to alter the image when you download it from it...
Last edited by ddtddt (2024-04-24 06:23:16)
Offline
Perhaps should I do a clean install of piwigo with the latest version ?
Is it possible to do this and keep some informations ? (users, groups, tags, ...) ?
Offline
The failing images have a 0x0a LF linefeed character prepended. That very much reminds of [Forum, topic 30939] Images truncated after upgrade to 11.1 and [Github] Piwigo issue #1297 and https://github.com/Piwigo/Piwigo/pull/1620
Offline
Hi,
I compared the two images with a HEX editor. The difference is the very first byte. There is an extra byte 0A in the newer (broken) file. When I remove this byte and save it the file is recognized as an image properly.
I don't know where this extra byte comes from and is injected into the file.
Last edited by OHappyDay (2024-04-11 13:53:10)
Offline
@AnthonyS: out of curiosity, what are the last 10 lines of your action.php file?
Offline
@erAck
Here are the last lines :
// Looking at the safe_mode configuration for execution time if (ini_get('safe_mode') == 0) { @set_time_limit(0); } // Without clean and flush there may be some image download problems, or image can be corrupted after download if (ob_get_length() !== FALSE) { ob_flush(); } flush(); @readfile($file); ?>
Seems to be the same content as the version in the downloadable installation files
@OHappyDay
Thanks for having a look. That's weird.
Last edited by AnthonyS (2024-04-11 15:15:08)
Offline