0

metadata_update_file_type on PSD gives "Uncaught ErrorException: fread(): Length parameter must be greater than 0"

tim11pop 1 month ago 0

I'm running into an issue when running the metadata_update_file_type.php script with a path. If the script hits any PSD file, it seems to give the below error:


203 /<path redacted>/2022-08-01-01.psd
Photos
Image properties
MWG->Creator


PHP Fatal error: Uncaught ErrorException: fread(): Length parameter must be greater than 0 in /var/www/filerun/system/classes/vendor/FileRun/Media/Image/Format/PSD.php:76
Stack trace:
#0 /var/www/filerun/system/classes/vendor/FileRun/Media/Image/Format/PSD.php(76): FileRun\{closure}()
#1 /var/www/filerun/system/classes/vendor/FileRun/Media/Image/Format/PSD.php(182): FileRun\Media\Image\Format\PSD::readResourceBlock()
#2 /var/www/filerun/system/classes/vendor/FileRun/Media/Image/Metadata/Reconcile.php(15): FileRun\Media\Image\Format\PSD->getIptc()
#3 /var/www/filerun/system/classes/vendor/FileRun/Media/Image/Metadata/Reconcile.php(79): FileRun\Media\Image\Metadata\Reconcile->reconcile_IPT_XMP()
#4 /var/www/filerun/system/classes/vendor/FileRun/Media/Image/Metadata/Reconcile.php(101): FileRun\Media\Image\Metadata\Reconcile->reconcile_EXIF_IPT_XMP()
#5 /var/www/filerun/system/classes/vendor/FileRun/Media/Image/Metadata/Reconcile.php(85): FileRun\Media\Image\Metadata\Reconcile->getCreator()
#6 /var/www/filerun/system/classes/vend in /var/www/filerun/system/classes/vendor/FileRun/Media/Image/Format/PSD.php on line 76

It seems to hit PNG/JPG files fine:

205 /<path redacted>/2022-08-01-25.png
Photos
Image properties
MWG->Creator
MWG->Copyright
MWG->DateCreated
MWG->Description
MWG->GPSlatitude
MWG->GPSlongitude
MWG->height
Height: 7016
MWG->width
Width: 4961
Tags
Rating

I'm running the following command:

php7.4 -c /etc/php/7.4/fpm/php.ini /var/www/filerun/cron/metadata_update_file_type.php "folder path"

The PSD file itself and is present:

-rw-r--r-- 1 www-data www-data 99M Aug 31 11:17

Running FileRun version: 20220519 on Ubuntu 20.04 with Apache2 and PHP 7.4.30 (cli) (built: Aug 1 2022 15:06:20) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.30, Copyright (c), by Zend Technologies

Any thoughts or help appreciated!