ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
module.graphic.jpg.php
Go to the documentation of this file.
1<?php
4// available at http://getid3.sourceforge.net //
5// or http://www.getid3.org //
7// See readme.txt for more details //
9// //
10// module.graphic.jpg.php //
11// module for analyzing JPEG Image files //
12// dependencies: NONE //
13// ///
15
16
18{
19
20
21 function getid3_jpg(&$fd, &$ThisFileInfo) {
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 }
68
69}
70
71
72?>
fseek($bytes, $whence=SEEK_SET)
Definition: getid3.php:1697
fread($bytes)
Definition: getid3.php:1685
getID3() by James Heinrich info@getid3.org //
getid3_jpg(&$fd, &$ThisFileInfo)
GetDataImageSize($imgData)
$errors