Problem: The "wrong filepath_file" is passed by /include/picture_metadata.inc.php #1960

Open
opened 2026-10-05 01:02:23 +02:00 by adam · 0 comments
Owner

The problem happend when you click on the thumbnail of a mediafile on page category
the function /include/picture_metadata.inc.php is then called

what happened is

in /include/picture_metadata.inc.php on line 24
$exif = get_exif_data($picture['current']['src_image']->get_path(), $exif_mapping); // the filepath of the thumnail is called
example
if no thumbnail created './themes/default/icon/mimetypes/unknown.png', <=== The original file is a pdf without preview thumbnail
or
if the file is a MP4 the filepath/thumbnail created created by piwigo-videojs is passed

This give problems with a PDF and other type's (MP4) because the function is going to try the exif data of this thumbnail file and because there is nothing it it returns nothing and/or in case of the './themes/default/icon/mimetypes/unknown.png' a
PHP Warning: exif_read_data(unknown.png): File not supported

imho it should take the path of the "real" file

Expectation:
expecting that the path of the "real file" like test.pdf is passed to /include/picture_metadata.inc.php and NOT the path of the represantieve image.

i changed the line 24 by
$exif = get_exif_data($picture['current']['path'], $exif_mapping); // real path of the mediafile

and now i'am getting al the metadata of the mediafile, even when i click on the button 'show metadata'

for me it works

here under is the result of the caputring while running the function with line 24 unchanged

include( '/mnt/DataDisk/www/test/piwigotest/include/picture_metadata.inc.php )
get_exif_data( $filename = './themes/default/icon/mimetypes/unknown.png',

{main}( )
include( '/mnt/DataDisk/www/test/piwigotest/include/page_header.php )
header( $header = 'Content-Type: text/html; charset=utf-8' )

include( '/mnt/DataDisk/www/test/piwigotest/include/picture_metadata.inc.php )
$exif = get_exif_data($picture['current']['src_image']->get_path(), $exif_mapping);

PHP Warning:  exif_read_data(unknown.png): File not supported

Srr for very bad english btw

The problem happend when you click on the thumbnail of a mediafile on page category the function /include/picture_metadata.inc.php is then called what happened is in /include/picture_metadata.inc.php on line 24 $exif = get_exif_data($picture['current']['src_image']->get_path(), $exif_mapping); // the filepath of the thumnail is called example if no thumbnail created './themes/default/icon/mimetypes/unknown.png', <=== The original file is a pdf without preview thumbnail or if the file is a MP4 the filepath/thumbnail created created by piwigo-videojs is passed This give problems with a PDF and other type's (MP4) because the function is going to try the exif data of this thumbnail file and because there is nothing it it returns nothing and/or in case of the './themes/default/icon/mimetypes/unknown.png' a PHP Warning: exif_read_data(unknown.png): File not supported imho it should take the path of the "real" file Expectation: expecting that the path of the "real file" like test.pdf is passed to /include/picture_metadata.inc.php and NOT the path of the represantieve image. i changed the line 24 by $exif = get_exif_data($picture['current']['path'], $exif_mapping); // real path of the mediafile and now i'am getting al the metadata of the mediafile, even when i click on the button 'show metadata' for me it works here under is the result of the caputring while running the function with line 24 unchanged include( '/mnt/DataDisk/www/test/piwigotest/include/picture_metadata.inc.php ) get_exif_data( $filename = './themes/default/icon/mimetypes/unknown.png', {main}( ) include( '/mnt/DataDisk/www/test/piwigotest/include/page_header.php ) header( $header = 'Content-Type: text/html; charset=utf-8' ) include( '/mnt/DataDisk/www/test/piwigotest/include/picture_metadata.inc.php ) $exif = get_exif_data($picture['current']['src_image']->get_path(), $exif_mapping); PHP Warning: exif_read_data(unknown.png): File not supported Srr for very bad english btw <!-- github-sync-id:2616547310 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1960