Skip to content

Commit 6fd8c72

Browse files
committed
Bugfix
1 parent ac70db3 commit 6fd8c72

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

lib/PHPExif/Adapter/FFprobe.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,25 @@ public function getExifFromFile($file)
4646
return false;
4747
}
4848

49+
$ffprobe = null;
50+
try {
51+
// Let's try use the default paths
52+
// No need to call exec(..) which takes time and might
53+
// not be possible
54+
$ffprobe = FFMpeg\FFProbe::create();
55+
} catch (\Exception $e) {
56+
// Let's try to pass paths explicitly
57+
// @codeCoverageIgnoreStart
58+
$path_ffmpeg = exec('which ffmpeg');
59+
$path_ffprobe = exec('which ffprobe');
60+
$ffprobe = FFMpeg\FFProbe::create(array(
61+
'ffmpeg.binaries' => $path_ffmpeg,
62+
'ffprobe.binaries' => $path_ffprobe,
63+
));
64+
// @codeCoverageIgnoreEnd
65+
}
66+
4967

50-
$ffprobe = FFMpeg\FFProbe::create();
5168

5269
$stream = $ffprobe->streams($file)->videos()->first()->all();
5370
$format = $ffprobe->format($file)->all();

lib/PHPExif/Mapper/Exiftool.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Exiftool implements MapperInterface
5555
const GPSLONGITUDE = 'GPS:GPSLongitude';
5656
const GPSALTITUDE = 'GPS:GPSAltitude';
5757
const IMGDIRECTION = 'GPS:GPSImgDirection';
58-
const DESCRIPTION = 'IFD0:ImageDescription ';
58+
const DESCRIPTION = 'ExifIFD:ImageDescription ';
5959
const MAKE = 'IFD0:Make';
6060
const LENS = 'ExifIFD:LensModel';
6161
const SUBJECT = 'XMP-dc:Subject';

0 commit comments

Comments
 (0)