Gallery 2.0.0 : Multi-upload doesn't work

Hello everybody,

i can upload images in Gallery (v.2.0.0) one by one, it works well.
But when i want to use the multi-upload method, it doesn’t work anymore.
Not only the thumbnails are not generated, but the images are not available on the frontend.

I think it’s since i upgraded extensions but I didn’t pay attention at that time.
Also, it worked in the past, i already have 50+ galleries created and working like it should.

i tried to understand the error log, but i didn’t. I think it’s a “path problem” but i’m not sure.
And i don’t want to break the existing galleries.

The log also tell me :

Error messages disabled.

edit phpThumb.config.php and (temporarily) set
$PHPTHUMB_CONFIG['disable_debug'] = false;
to view the details of this error in file "phpthumb.class.php" on line 4269
    [39] => SourceImageToGD() failed in file "phpthumb.class.php" on line 379
)

But i am unable to find any phpThumb.config.php file !!!

here is a short visual demo of the problem :

and the log :


[2022-09-05 17:01:12] (ERROR @ /home/verdaij/www/core/components/gallery/processors/web/phpthumb.class.php : 187) PHP warning: filemtime(): stat failed for /home/verdaij/www/assets/components/gallery/cache/https___verda-immobilier.com_assets_gallery_58_1019.jpg.d9364263d73067e6372bffd748659d34.jpg
[2022-09-05 17:01:12] (ERROR @ /home/verdaij/www/core/components/gallery/processors/web/phpthumb.class.php : 199) PHP warning: file_get_contents(/home/verdaij/www/assets/components/gallery/cache/https___verda-immobilier.com_assets_gallery_58_1019.jpg.d9364263d73067e6372bffd748659d34.jpg): failed to open stream: No such file or directory
[2022-09-05 17:01:21] (ERROR @ /home/verdaij/www/core/model/phpthumb/phpthumb.class.php : 3756) PHP warning: filesize(): stat failed for https://verda-immobilier.com/assets/gallery/58/1021.jpg
[2022-09-05 17:01:21] (ERROR @ /home/verdaij/www/core/components/gallery/processors/web/phpthumb.class.php : 181) [phpThumbOf] Could not generate thumbnail: https://verda-immobilier.com/assets/gallery/58/1021.jpg - Debug: Array
(
    [0] => phpThumb() v1.7.16-202012161640 in file "phpthumb.class.php" on line 234
    [1] => setSourceFilename(https://verda-immobilier.com/assets/gallery/58/1021.jpg) set $this->sourceFilename to "https://verda-immobilier.com/assets/gallery/58/1021.jpg" in file "phpthumb.class.php" on line 299
    [2] => setSourceFilename(https://verda-immobilier.com/assets/gallery/58/1021.jpg) set $this->sourceFilename to "https://verda-immobilier.com/assets/gallery/58/1021.jpg" in file "phpthumb.class.php" on line 299
    [3] => CleanUpCacheDirectory() set to purge (NULL days; NULL MB; NULL files) in file "phpthumb.class.php" on line 751
    [4] => CleanUpCacheDirectory() skipped because "/home/verdaij/www/assets/components/gallery/cache//phpThumbCacheStats.txt" is recently modified in file "phpthumb.class.php" on line 761
    [5] => $AvailableImageOutputFormats = array(text;ico;bmp;wbmp;gif;webp;png;jpeg) in file "phpthumb.class.php" on line 1012
    [6] => $this->thumbnailFormat set to $this->config_output_format "jpeg" in file "phpthumb.class.php" on line 1023
    [7] => $this->thumbnailFormat set to $this->f "jpeg" in file "phpthumb.class.php" on line 1030
    [8] => $this->thumbnailQuality set to "75" in file "phpthumb.class.php" on line 1040
    [9] => $this->sourceFilename set to "https://verda-immobilier.com/assets/gallery/58/1021.jpg" in file "phpthumb.class.php" on line 933
    [10] => SetCacheFilename() _src set from md5($this->sourceFilename) "https://verda-immobilier.com/assets/gallery/58/1021.jpg" = "3935ecc3411711efcdc01d6be5952c7a" in file "phpthumb.class.php" on line 3616
    [11] => SetCacheFilename() _par set from md5(_farC_dpi150_q75) in file "phpthumb.class.php" on line 3655
    [12] => starting ExtractEXIFgetImageSize() in file "phpthumb.class.php" on line 3409
    [13] => getimagesize(https://verda-immobilier.com/assets/gallery/58/1021.jpg) failed in file "phpthumb.class.php" on line 3421
    [14] => getimagesize("https://verda-immobilier.com/assets/gallery/58/1021.jpg") failed in file "phpthumb.class.php" on line 3451
    [15] => $this->useRawIMoutput=true after checking $UnAllowedParameters in file "phpthumb.class.php" on line 1655
    [16] => phpThumb_tempnam() returning "/tmp/pThumbIzLVva" in file "phpthumb.class.php" on line 4498
    [17] => ImageMagickSwitchAvailable(thumbnail) = 0 in file "phpthumb.class.php" on line 1581
    [18] => IMuseExplicitImageOutputDimensions = 0 in file "phpthumb.class.php" on line 1736
    [19] => getimagesize(https://verda-immobilier.com/assets/gallery/58/1021.jpg) FAILED with error "" in file "phpthumb.class.php" on line 1752
    [20] => ImageMagickSwitchAvailable(density) = 0 in file "phpthumb.class.php" on line 1581
    [21] => getimagesize(https://verda-immobilier.com/assets/gallery/58/1021.jpg) failed in file "phpthumb.class.php" on line 1932
    [22] => Remaining $this->fltr after ImageMagick: (array(0) { } ) in file "phpthumb.class.php" on line 2316
    [23] => ImageMagickSwitchAvailable(quality;interlace) = 0 in file "phpthumb.class.php" on line 1578
    [24] => ImageMagick called as ('' 'https://verda-immobilier.com/assets/gallery/58/1021.jpg[0]' jpeg:'/tmp/pThumbIzLVva' 2>&1) in file "phpthumb.class.php" on line 2334
    [25] => ImageMagick failed with message (sh: : command not found) in file "phpthumb.class.php" on line 2339
    [26] => deleting "/tmp/pThumbIzLVva" in file "phpthumb.class.php" on line 2371
    [27] => ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 3458
    [28] => SetOrientationDependantWidthHeight() starting with ""x"" in file "phpthumb.class.php" on line 3388
    [29] => SetOrientationDependantWidthHeight() setting w="0", h="0" in file "phpthumb.class.php" on line 3404
    [30] => EXIF thumbnail extraction: (size=0; type=""; 0x0) in file "phpthumb.class.php" on line 3517
    [31] => starting SourceImageToGD() in file "phpthumb.class.php" on line 3781
    [32] => starting ImageCreateFromFilename(https://verda-immobilier.com/assets/gallery/58/1021.jpg) in file "phpthumb.class.php" on line 3696
    [33] => empty $filename or getimagesize(https://verda-immobilier.com/assets/gallery/58/1021.jpg) failed in file "phpthumb.class.php" on line 3745
    [34] => Populating $rawimagedata in file "phpthumb.class.php" on line 3753
    [35] => Not using EXIF thumbnail data because $this->exif_thumbnail_data is empty in file "phpthumb.class.php" on line 3853
    [36] => $this->gdimg_source is still empty in file "phpthumb.class.php" on line 3905
    [37] => ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 3907
    [38] => phpThumb() v1.7.16-202012161640
http://phpthumb.sourceforge.net

Error messages disabled.

edit phpThumb.config.php and (temporarily) set
$PHPTHUMB_CONFIG['disable_debug'] = false;
to view the details of this error in file "phpthumb.class.php" on line 4269
    [39] => SourceImageToGD() failed in file "phpthumb.class.php" on line 379
)

[2022-09-05 17:01:21] (ERROR @ /home/verdaij/www/core/components/gallery/processors/web/phpthumb.class.php : 187) PHP warning: filemtime(): stat failed for /home/verdaij/www/assets/components/gallery/cache/https___verda-immobilier.com_assets_gallery_58_1021.jpg.d13bc9ad8e355606a3005095d520443b.jpg
[2022-09-05 17:01:21] (ERROR @ /home/verdaij/www/core/components/gallery/processors/web/phpthumb.class.php : 199) PHP warning: file_get_contents(/home/verdaij/www/assets/components/gallery/cache/https___verda-immobilier.com_assets_gallery_58_1021.jpg.d13bc9ad8e355606a3005095d520443b.jpg): failed to open stream: No such file or directory

can anyone help me ?

Apply this fix:

thank you for the quick answer,
but
i added the line, cleared the cache, create a new gallery… but it doesn’t solve the problem.

Also, PHPStorm tell me that $byte isn’t used anywhere, and the function just return $filename.

Modx 2.8.3 - Gallery 2.0.0 - MySQL 5.7.38-log

Can you check the directory core/cache/gallery-tmp? The code should copy the uploaded image file from this temporary directory to the gallery directory (assets/gallery).

$bytes is just the total amount of bytes copied. This is not important.

the core/cache/gallery-tmp directory exists but is empty

the assets/gallery contains my 55 previous galleries folders
=> and also the new folders, with images files uploaded with multi-upload !
But each of them are 0 octet !!

i also just tried on my dev server (another machine) and the problem is exactly the same.

This is exactly the behaviour without the fixed line ($bytes = stream_copy_to_stream($input, $target);).
Are you sure you added it correctly (in the file core/components/gallery/model/gallery/galalbum.class.php)?

I was sure …
but i was on the wrong server !

SORRY to make you lose your time.
I confirm that adding this line solve the problem.

Thank you for you patience