ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
getid3_jpg Class Reference

getID3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g // More...

+ Collaboration diagram for getid3_jpg:

Public Member Functions

 getid3_jpg (&$fd, &$ThisFileInfo)
 

Detailed Description

getID3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g //

Definition at line 17 of file module.graphic.jpg.php.

Member Function Documentation

◆ getid3_jpg()

getid3_jpg::getid3_jpg ( $fd,
$ThisFileInfo 
)

Definition at line 21 of file module.graphic.jpg.php.

21 {
22 $ThisFileInfo['fileformat'] = 'jpg';
23 $ThisFileInfo['video']['dataformat'] = 'jpg';
24 $ThisFileInfo['video']['lossless'] = false;
25 $ThisFileInfo['video']['bits_per_sample'] = 24;
26 $ThisFileInfo['video']['pixel_aspect_ratio'] = (float) 1;
27
28 fseek($fd, $ThisFileInfo['avdataoffset'], SEEK_SET);
29
30 list($width, $height, $type) = getid3_lib::GetDataImageSize(fread($fd, $ThisFileInfo['filesize']));
31 if ($type == 2) {
32
33 $ThisFileInfo['video']['resolution_x'] = $width;
34 $ThisFileInfo['video']['resolution_y'] = $height;
35
36 if (version_compare(phpversion(), '4.2.0', '>=')) {
37
38 if (function_exists('exif_read_data')) {
39
40 ob_start();
41 $ThisFileInfo['jpg']['exif'] = exif_read_data($ThisFileInfo['filenamepath'], '', true, false);
42 $errors = ob_get_contents();
43 if ($errors) {
44 $ThisFileInfo['error'][] = strip_tags($errors);
45 unset($ThisFileInfo['jpg']['exif']);
46 }
47 ob_end_clean();
48
49 } else {
50
51 $ThisFileInfo['warning'][] = 'EXIF parsing only available when '.(GETID3_OS_ISWINDOWS ? 'php_exif.dll enabled' : 'compiled with --enable-exif');
52
53 }
54
55 } else {
56
57 $ThisFileInfo['warning'][] = 'EXIF parsing only available in PHP v4.2.0 and higher compiled with --enable-exif (or php_exif.dll enabled for Windows). You are using PHP v'.phpversion();
58
59 }
60
61 return true;
62
63 }
64
65 unset($ThisFileInfo['fileformat']);
66 return false;
67 }
GetDataImageSize($imgData)
$errors

References $errors, and getid3_lib\GetDataImageSize().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: