File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -346,6 +346,10 @@ public function getExposureMilliseconds()
346346 return false ;
347347 }
348348
349+ if (is_float ($ this ->data [self ::EXPOSURE ])) {
350+ return $ this ->data [self ::EXPOSURE ];
351+ }
352+
349353 $ exposureParts = explode ('/ ' , $ this ->data [self ::EXPOSURE ]);
350354
351355 return (int ) reset ($ exposureParts ) / (int ) end ($ exposureParts );
Original file line number Diff line number Diff line change @@ -219,10 +219,19 @@ public function testGetExposure()
219219 */
220220 public function testGetExposureMilliseconds ()
221221 {
222- $ expected = 1 /320 ;
223- $ data [\PHPExif \Exif::EXPOSURE ] = '1/320 ' ;
224- $ this ->exif ->setData ($ data );
225- $ this ->assertEquals ($ expected , $ this ->exif ->getExposureMilliseconds ());
222+ $ rawData = array (
223+ array (1 /300 , '1/300 ' ),
224+ array (0.0025 , 0.0025 ),
225+ );
226+
227+ foreach ($ rawData as $ data ) {
228+ $ expected = reset ($ data );
229+ $ value = end ($ data );
230+
231+ $ data [\PHPExif \Exif::EXPOSURE ] = $ value ;
232+ $ this ->exif ->setData ($ data );
233+ $ this ->assertEquals ($ expected , $ this ->exif ->getExposureMilliseconds ());
234+ }
226235 }
227236
228237 /**
You can’t perform that action at this time.
0 commit comments