Skip to content

exif_read_data() returns fields incorrectly for camera RAW files #17483

@t-rutter

Description

@t-rutter

Description

May possibly be related to #11020

The following code:

<?php
$exifData = @exif_read_data($filePath);
echo $exifData['StripOffsets'] ."\n";
echo $exifData['StripByteCounts'] ."\n";
print_r($exifData['BitsPerSample'])

Resulted in this output:

160528
57600
Array
(
    [0] => 8
    [1] => 8
    [2] => 8
)

StripOffsets does not reference either the start of the main image data or any other data portions like previews.

Below are values return by exiftool and been check to be valid
But I expected this output instead:

1557504
16916475
Array
(
    [0] => 14
    [1] => 14
    [2] => 14
)

exif_read_data() should return valid field values or not return them.
No warnings or errors from PHP

PHP Version

PHP 8.2.21

Operating System

Synology DSM 7.2.2-72806 Update 2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions