EXIF value misses the last character
svenbluege opened this issue · comments
Sven Bluege commented
I use the following code snippet to read the camera model:
<?php
setlocale(LC_ALL, '');
require_once '../autoload.php';
use lsolesen\pel\PelDataWindow;
use lsolesen\pel\PelJpeg;
use lsolesen\pel\PelTiff;
use lsolesen\pel\Pel;
use lsolesen\pel\PelTag;
$prog = array_shift($argv);
$file = $argv[0];;
Pel::setDebug(true);
$input_jpeg = new PelJpeg($file);
$app1 = $input_jpeg->getExif();
$tiff = $app1->getTiff();
$ifd0 = $tiff->getIfd();
echo $ifd0->getEntry(PelTag::MODEL);
The code returns this for the attached image file:
/> php dump-image.php D:\temp\event\test7\20161125_124812_p4101ldrnightstrong.jpg
Tag: 0x0110 (Model)
Format : 2 (Ascii)
Components: 21
Value : Canon EOS 5D Mark II
Text : Canon EOS 5D Mark II
As you can see, it states a Canon 5D Mark II but actually it is a 5D MK III. The last character got lost somehow. The same file works fine in other exif tools:
Do you have any clue what is wrong here? I'm a bit clueless here.
Lars Olesen commented
Could you make a pull request with your Test?
Sven Bluege commented
on its way :)
Sven Bluege commented
Awesome! Thank you!