@@ -15,69 +15,69 @@ discard block |
||
15 | 15 | class exif |
16 | 16 | { |
17 | 17 | /** |
18 | - * Default value for new users |
|
19 | - */ |
|
18 | + * Default value for new users |
|
19 | + */ |
|
20 | 20 | const DEFAULT_DISPLAY = true; |
21 | 21 | |
22 | 22 | /** |
23 | - * phpBB will treat the time from the Exif data like UTC. |
|
24 | - * If your images were taken with an other timezone, you can insert an offset here. |
|
25 | - * The offset is than added to the timestamp before it is converted into the users time. |
|
26 | - * |
|
27 | - * Offset must be set in seconds. |
|
28 | - */ |
|
23 | + * phpBB will treat the time from the Exif data like UTC. |
|
24 | + * If your images were taken with an other timezone, you can insert an offset here. |
|
25 | + * The offset is than added to the timestamp before it is converted into the users time. |
|
26 | + * |
|
27 | + * Offset must be set in seconds. |
|
28 | + */ |
|
29 | 29 | const TIME_OFFSET = 0; |
30 | 30 | |
31 | 31 | /** |
32 | - * Constants for the status of the Exif data. |
|
33 | - */ |
|
32 | + * Constants for the status of the Exif data. |
|
33 | + */ |
|
34 | 34 | const UNAVAILABLE = 0; |
35 | 35 | const AVAILABLE = 1; |
36 | 36 | const UNKNOWN = 2; |
37 | 37 | const DBSAVED = 3; |
38 | 38 | |
39 | 39 | /** |
40 | - * Is the function available? |
|
41 | - */ |
|
40 | + * Is the function available? |
|
41 | + */ |
|
42 | 42 | static public $function_exists = null; |
43 | 43 | |
44 | 44 | /** |
45 | - * Exif data array with all allowed groups and keys. |
|
46 | - */ |
|
45 | + * Exif data array with all allowed groups and keys. |
|
46 | + */ |
|
47 | 47 | public $data = array(); |
48 | 48 | |
49 | 49 | /** |
50 | - * Filtered data array. We don't have empty or invalid values here. |
|
51 | - */ |
|
50 | + * Filtered data array. We don't have empty or invalid values here. |
|
51 | + */ |
|
52 | 52 | public $prepared_data = array(); |
53 | 53 | |
54 | 54 | /** |
55 | - * Does the image have exif data? |
|
56 | - * Values see constant declaration at the beginning of the class. |
|
57 | - */ |
|
55 | + * Does the image have exif data? |
|
56 | + * Values see constant declaration at the beginning of the class. |
|
57 | + */ |
|
58 | 58 | public $status = 2; |
59 | 59 | |
60 | 60 | /** |
61 | - * Full data array, but serialized to a string |
|
62 | - */ |
|
61 | + * Full data array, but serialized to a string |
|
62 | + */ |
|
63 | 63 | public $serialized = ''; |
64 | 64 | |
65 | 65 | /** |
66 | - * Full link to the image-file |
|
67 | - */ |
|
66 | + * Full link to the image-file |
|
67 | + */ |
|
68 | 68 | public $file = ''; |
69 | 69 | |
70 | 70 | /** |
71 | - * Image-ID, just needed to update the Exif status |
|
72 | - */ |
|
71 | + * Image-ID, just needed to update the Exif status |
|
72 | + */ |
|
73 | 73 | public $image_id = false; |
74 | 74 | |
75 | 75 | /** |
76 | - * Constructor |
|
77 | - * |
|
78 | - * @param string $file Full link to the image-file |
|
79 | - * @param mixed $image_id False or integer |
|
80 | - */ |
|
76 | + * Constructor |
|
77 | + * |
|
78 | + * @param string $file Full link to the image-file |
|
79 | + * @param mixed $image_id False or integer |
|
80 | + */ |
|
81 | 81 | public function __construct($file, $image_id = false) |
82 | 82 | { |
83 | 83 | if (self::$function_exists === null) |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
96 | - * Intepret the values from the database, and read the data if we don't have it. |
|
97 | - * |
|
98 | - * @param int $status Value of a status constant (see beginning of the class) |
|
99 | - * @param mixed $data Either an empty string or the serialized array of the Exif from the database |
|
100 | - */ |
|
96 | + * Intepret the values from the database, and read the data if we don't have it. |
|
97 | + * |
|
98 | + * @param int $status Value of a status constant (see beginning of the class) |
|
99 | + * @param mixed $data Either an empty string or the serialized array of the Exif from the database |
|
100 | + */ |
|
101 | 101 | public function interpret($status, $data) |
102 | 102 | { |
103 | 103 | $this->orig_status = $status; |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
116 | - * Read Exif data from the image |
|
117 | - */ |
|
116 | + * Read Exif data from the image |
|
117 | + */ |
|
118 | 118 | public function read() |
119 | 119 | { |
120 | 120 | if (!self::$function_exists || !$this->file || !file_exists($this->file)) |
@@ -160,8 +160,8 @@ discard block |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
163 | - * Validate and prepare the data, so we can send it into the template. |
|
164 | - */ |
|
163 | + * Validate and prepare the data, so we can send it into the template. |
|
164 | + */ |
|
165 | 165 | private function prepare_data() |
166 | 166 | { |
167 | 167 | global $user; |
@@ -268,11 +268,11 @@ discard block |
||
268 | 268 | } |
269 | 269 | |
270 | 270 | /** |
271 | - * Sends the Exif into the template |
|
272 | - * |
|
273 | - * @param bool $expand_view Shall we expand the Exif data on page view or collapse? |
|
274 | - * @param string $block Name of the template loop the Exifs are displayed in. |
|
275 | - */ |
|
271 | + * Sends the Exif into the template |
|
272 | + * |
|
273 | + * @param bool $expand_view Shall we expand the Exif data on page view or collapse? |
|
274 | + * @param string $block Name of the template loop the Exifs are displayed in. |
|
275 | + */ |
|
276 | 276 | public function send_to_template($expand_view = true, $block = 'exif_value') |
277 | 277 | { |
278 | 278 | $this->prepare_data(); |
@@ -296,8 +296,8 @@ discard block |
||
296 | 296 | } |
297 | 297 | |
298 | 298 | /** |
299 | - * Save the new Exif status in the database |
|
300 | - */ |
|
299 | + * Save the new Exif status in the database |
|
300 | + */ |
|
301 | 301 | public function set_status() |
302 | 302 | { |
303 | 303 | if (!$this->image_id || ($this->orig_status == $this->status)) |
@@ -315,9 +315,9 @@ discard block |
||
315 | 315 | } |
316 | 316 | |
317 | 317 | /** |
318 | - * There are lots of possible Exif Groups and Values. |
|
319 | - * But you will never heard of the missing ones. so we just allow the most common ones. |
|
320 | - */ |
|
318 | + * There are lots of possible Exif Groups and Values. |
|
319 | + * But you will never heard of the missing ones. so we just allow the most common ones. |
|
320 | + */ |
|
321 | 321 | static private $allowed_groups = array( |
322 | 322 | 'EXIF', |
323 | 323 | 'IFD0', |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * Default value for new users |
19 | 19 | */ |
20 | - const DEFAULT_DISPLAY = true; |
|
20 | + const DEFAULT_DISPLAY = true; |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * phpBB will treat the time from the Exif data like UTC. |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | * |
27 | 27 | * Offset must be set in seconds. |
28 | 28 | */ |
29 | - const TIME_OFFSET = 0; |
|
29 | + const TIME_OFFSET = 0; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Constants for the status of the Exif data. |
33 | 33 | */ |
34 | - const UNAVAILABLE = 0; |
|
35 | - const AVAILABLE = 1; |
|
34 | + const UNAVAILABLE = 0; |
|
35 | + const AVAILABLE = 1; |
|
36 | 36 | const UNKNOWN = 2; |
37 | 37 | const DBSAVED = 3; |
38 | 38 | |
@@ -44,33 +44,33 @@ discard block |
||
44 | 44 | /** |
45 | 45 | * Exif data array with all allowed groups and keys. |
46 | 46 | */ |
47 | - public $data = array(); |
|
47 | + public $data = array(); |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Filtered data array. We don't have empty or invalid values here. |
51 | 51 | */ |
52 | - public $prepared_data = array(); |
|
52 | + public $prepared_data = array(); |
|
53 | 53 | |
54 | 54 | /** |
55 | 55 | * Does the image have exif data? |
56 | 56 | * Values see constant declaration at the beginning of the class. |
57 | 57 | */ |
58 | - public $status = 2; |
|
58 | + public $status = 2; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Full data array, but serialized to a string |
62 | 62 | */ |
63 | - public $serialized = ''; |
|
63 | + public $serialized = ''; |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Full link to the image-file |
67 | 67 | */ |
68 | - public $file = ''; |
|
68 | + public $file = ''; |
|
69 | 69 | |
70 | 70 | /** |
71 | 71 | * Image-ID, just needed to update the Exif status |
72 | 72 | */ |
73 | - public $image_id = false; |
|
73 | + public $image_id = false; |
|
74 | 74 | |
75 | 75 | /** |
76 | 76 | * Constructor |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | } |
202 | 202 | else if ($num) |
203 | 203 | { |
204 | - $exif_exposure = ' 1/' . $den / $num ; |
|
204 | + $exif_exposure = ' 1/' . $den / $num; |
|
205 | 205 | } |
206 | 206 | if ($exif_exposure) |
207 | 207 | { |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | } |
245 | 245 | if (isset($this->data["EXIF"]["ExposureBiasValue"])) |
246 | 246 | { |
247 | - list($num,$den) = explode("/", $this->data["EXIF"]["ExposureBiasValue"]); |
|
247 | + list($num, $den) = explode("/", $this->data["EXIF"]["ExposureBiasValue"]); |
|
248 | 248 | if ($den) |
249 | 249 | { |
250 | 250 | if (($num / $den) == 0) |
@@ -318,12 +318,12 @@ discard block |
||
318 | 318 | * There are lots of possible Exif Groups and Values. |
319 | 319 | * But you will never heard of the missing ones. so we just allow the most common ones. |
320 | 320 | */ |
321 | - static private $allowed_groups = array( |
|
321 | + static private $allowed_groups = array( |
|
322 | 322 | 'EXIF', |
323 | 323 | 'IFD0', |
324 | 324 | ); |
325 | 325 | |
326 | - static private $allowed_keys = array( |
|
326 | + static private $allowed_keys = array( |
|
327 | 327 | 'DateTimeOriginal', |
328 | 328 | 'FocalLength', |
329 | 329 | 'ExposureTime', |
@@ -105,8 +105,7 @@ discard block |
||
105 | 105 | if ($this->status == self::DBSAVED) |
106 | 106 | { |
107 | 107 | $this->data = unserialize($data); |
108 | - } |
|
109 | - else if (($this->status == self::AVAILABLE) || ($this->status == self::UNKNOWN)) |
|
108 | + } else if (($this->status == self::AVAILABLE) || ($this->status == self::UNKNOWN)) |
|
110 | 109 | { |
111 | 110 | $this->read(); |
112 | 111 | } |
@@ -132,8 +131,7 @@ discard block |
||
132 | 131 | if (!in_array($key, self::$allowed_groups)) |
133 | 132 | { |
134 | 133 | unset($this->data[$key]); |
135 | - } |
|
136 | - else |
|
134 | + } else |
|
137 | 135 | { |
138 | 136 | foreach ($this->data[$key] as $subkey => $array) |
139 | 137 | { |
@@ -147,8 +145,7 @@ discard block |
||
147 | 145 | |
148 | 146 | $this->serialized = serialize($this->data); |
149 | 147 | $this->status = self::DBSAVED; |
150 | - } |
|
151 | - else |
|
148 | + } else |
|
152 | 149 | { |
153 | 150 | $this->status = self::UNAVAILABLE; |
154 | 151 | } |
@@ -198,8 +195,7 @@ discard block |
||
198 | 195 | if (($num > $den) && $den) |
199 | 196 | { |
200 | 197 | $exif_exposure = $num / $den; |
201 | - } |
|
202 | - else if ($num) |
|
198 | + } else if ($num) |
|
203 | 199 | { |
204 | 200 | $exif_exposure = ' 1/' . $den / $num ; |
205 | 201 | } |
@@ -250,8 +246,7 @@ discard block |
||
250 | 246 | if (($num / $den) == 0) |
251 | 247 | { |
252 | 248 | $exif_exposure_bias = 0; |
253 | - } |
|
254 | - else |
|
249 | + } else |
|
255 | 250 | { |
256 | 251 | $exif_exposure_bias = $this->data["EXIF"]["ExposureBiasValue"]; |
257 | 252 | } |
@@ -36,16 +36,16 @@ |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
39 | - * Constructor |
|
40 | - * NOTE: The parameters of this method must match in order and type with |
|
41 | - * the dependencies defined in the services.yml file for this service. |
|
42 | - * |
|
43 | - * @param \phpbb\user $user User object |
|
44 | - * @param \phpbbgallery\core\config $gallery_config Core gallery config object |
|
45 | - * @param \phpbbgallery\core\auth\auth $gallery_auth Core gallery auth object |
|
46 | - * @param \phpbbgallery\core\url $gallery_url Core gallery url object |
|
47 | - * @param \phpbbgallery\core\user $gallery_user Core gallery user wraper |
|
48 | - */ |
|
39 | + * Constructor |
|
40 | + * NOTE: The parameters of this method must match in order and type with |
|
41 | + * the dependencies defined in the services.yml file for this service. |
|
42 | + * |
|
43 | + * @param \phpbb\user $user User object |
|
44 | + * @param \phpbbgallery\core\config $gallery_config Core gallery config object |
|
45 | + * @param \phpbbgallery\core\auth\auth $gallery_auth Core gallery auth object |
|
46 | + * @param \phpbbgallery\core\url $gallery_url Core gallery url object |
|
47 | + * @param \phpbbgallery\core\user $gallery_user Core gallery user wraper |
|
48 | + */ |
|
49 | 49 | |
50 | 50 | public function __construct(\phpbb\user $user, \phpbbgallery\core\config $gallery_config, \phpbbgallery\core\auth\auth $gallery_auth, \phpbbgallery\core\url $gallery_url, \phpbbgallery\core\user $gallery_user) |
51 | 51 | { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $this->user = $user; |
53 | 53 | $this->gallery_config = $gallery_config; |
54 | 54 | $this->gallery_auth = $gallery_auth; |
55 | - $this->gallery_url = $gallery_url; |
|
55 | + $this->gallery_url = $gallery_url; |
|
56 | 56 | $this->gallery_user = $gallery_user; |
57 | 57 | } |
58 | 58 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | $this->user->add_lang_ext('phpbbgallery/exif', 'exif'); |
67 | 67 | |
68 | - $return_ary['vars']['IMAGE_SETTINGS']['disp_exifdata'] = array('lang' => 'DISP_EXIF_DATA', 'validate' => 'bool', 'type' => 'radio:yes_no'); |
|
68 | + $return_ary['vars']['IMAGE_SETTINGS']['disp_exifdata'] = array('lang' => 'DISP_EXIF_DATA', 'validate' => 'bool', 'type' => 'radio:yes_no'); |
|
69 | 69 | $event['return_ary'] = $return_ary; |
70 | 70 | } |
71 | 71 | } |
@@ -146,8 +146,7 @@ |
||
146 | 146 | |
147 | 147 | $event['additional_sql_data'] = $additional_sql_data; |
148 | 148 | unset($exif); |
149 | - } |
|
150 | - else |
|
149 | + } else |
|
151 | 150 | { |
152 | 151 | $additional_sql_data = $event['additional_sql_data']; |
153 | 152 | $additional_sql_data['image_exif_data'] = ''; |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | 'EXIF_CAM_MODEL' => 'Camera-model', |
31 | 31 | 'EXIF_DATE' => 'Image taken on', |
32 | 32 | 'EXIF_EXPOSURE' => 'Shutter speed', |
33 | - 'EXIF_EXPOSURE_EXP' => '%s Sec',// 'EXIF_EXPOSURE' unit |
|
33 | + 'EXIF_EXPOSURE_EXP' => '%s Sec', // 'EXIF_EXPOSURE' unit |
|
34 | 34 | 'EXIF_EXPOSURE_BIAS' => 'Exposure bias', |
35 | - 'EXIF_EXPOSURE_BIAS_EXP' => '%s EV',// 'EXIF_EXPOSURE_BIAS' unit |
|
35 | + 'EXIF_EXPOSURE_BIAS_EXP' => '%s EV', // 'EXIF_EXPOSURE_BIAS' unit |
|
36 | 36 | 'EXIF_EXPOSURE_PROG' => 'Exposure program', |
37 | 37 | 'EXIF_EXPOSURE_PROG_0' => 'Not defined', |
38 | 38 | 'EXIF_EXPOSURE_PROG_1' => 'Manual', |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | 'EXIF_FLASH_CASE_93' => 'Flash fired, auto mode, return light not detected, red-eye reduction mode', |
73 | 73 | 'EXIF_FLASH_CASE_95' => 'Flash fired, auto mode, return light detected, red-eye reduction mode', |
74 | 74 | 'EXIF_FOCAL' => 'Focus length', |
75 | - 'EXIF_FOCAL_EXP' => '%s mm',// 'EXIF_FOCAL' unit |
|
75 | + 'EXIF_FOCAL_EXP' => '%s mm', // 'EXIF_FOCAL' unit |
|
76 | 76 | 'EXIF_ISO' => 'ISO speed rating', |
77 | 77 | 'EXIF_METERING_MODE' => 'Metering mode', |
78 | 78 | 'EXIF_METERING_MODE_0' => 'Unknown', |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | 'EXIF_CAM_MODEL' => 'Модель камеры', |
32 | 32 | 'EXIF_DATE' => 'Изображение заснято', |
33 | 33 | 'EXIF_EXPOSURE' => 'Выдержка', |
34 | - 'EXIF_EXPOSURE_EXP' => '%s сек',// 'EXIF_EXPOSURE' unit |
|
34 | + 'EXIF_EXPOSURE_EXP' => '%s сек', // 'EXIF_EXPOSURE' unit |
|
35 | 35 | 'EXIF_EXPOSURE_BIAS' => 'Корректировка выдержки', |
36 | - 'EXIF_EXPOSURE_BIAS_EXP' => '%s LW',// 'EXIF_EXPOSURE_BIAS' unit |
|
36 | + 'EXIF_EXPOSURE_BIAS_EXP' => '%s LW', // 'EXIF_EXPOSURE_BIAS' unit |
|
37 | 37 | 'EXIF_EXPOSURE_PROG' => 'Программа экспозиции', |
38 | 38 | 'EXIF_EXPOSURE_PROG_0' => 'Неопределенно', |
39 | 39 | 'EXIF_EXPOSURE_PROG_1' => 'Вручную', |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | 'EXIF_FLASH_CASE_93' => 'Вспышка сработала, авторежим, нет отражателя вспышки, подавление эффекта красных глаз', |
74 | 74 | 'EXIF_FLASH_CASE_95' => 'Вспышка сработала, авторежим, отражатель вспышки сработал, подавление эффекта красных глаз', |
75 | 75 | 'EXIF_FOCAL' => 'Фокусное расстояние', |
76 | - 'EXIF_FOCAL_EXP' => '%s mm',// 'EXIF_FOCAL' unit |
|
76 | + 'EXIF_FOCAL_EXP' => '%s mm', // 'EXIF_FOCAL' unit |
|
77 | 77 | 'EXIF_ISO' => 'ISO-чувствительность', |
78 | 78 | 'EXIF_METERING_MODE' => 'Метод выдержки и измерения', |
79 | 79 | 'EXIF_METERING_MODE_0' => 'Неизвестно', |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | 'EXIF_CAM_MODEL' => 'Kamera-Modell', |
32 | 32 | 'EXIF_DATE' => 'Bild aufgenommen am', |
33 | 33 | 'EXIF_EXPOSURE' => 'Belichtungszeit', |
34 | - 'EXIF_EXPOSURE_EXP' => '%s Sek',// 'EXIF_EXPOSURE' unit |
|
34 | + 'EXIF_EXPOSURE_EXP' => '%s Sek', // 'EXIF_EXPOSURE' unit |
|
35 | 35 | 'EXIF_EXPOSURE_BIAS' => 'Belichtungskorrektur', |
36 | - 'EXIF_EXPOSURE_BIAS_EXP' => '%s LW',// 'EXIF_EXPOSURE_BIAS' unit |
|
36 | + 'EXIF_EXPOSURE_BIAS_EXP' => '%s LW', // 'EXIF_EXPOSURE_BIAS' unit |
|
37 | 37 | 'EXIF_EXPOSURE_PROG' => 'Belichtungsprogramm', |
38 | 38 | 'EXIF_EXPOSURE_PROG_0' => 'Nicht definiert', |
39 | 39 | 'EXIF_EXPOSURE_PROG_1' => 'Manuell', |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | 'EXIF_FLASH_CASE_93' => 'Blitz wurde ausgelöst, Automodus, kein Messblitz-Licht zurückgeworfen, Rote-Augen-Reduzierung', |
74 | 74 | 'EXIF_FLASH_CASE_95' => 'Blitz wurde ausgelöst, Automodus, Messblitz-Licht zurückgeworfen, Rote-Augen-Reduzierung', |
75 | 75 | 'EXIF_FOCAL' => 'Brennweite', |
76 | - 'EXIF_FOCAL_EXP' => '%s mm',// 'EXIF_FOCAL' unit |
|
76 | + 'EXIF_FOCAL_EXP' => '%s mm', // 'EXIF_FOCAL' unit |
|
77 | 77 | 'EXIF_ISO' => 'ISO-Empfindlichkeit', |
78 | 78 | 'EXIF_METERING_MODE' => 'Belichtungs- Messmethode', |
79 | 79 | 'EXIF_METERING_MODE_0' => 'Unbekannt', |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | 'EXIF_CAM_MODEL' => 'Modèle d’appareil photo', |
32 | 32 | 'EXIF_DATE' => 'Image prise le', |
33 | 33 | 'EXIF_EXPOSURE' => 'Vitesse d’obturation', |
34 | - 'EXIF_EXPOSURE_EXP' => '%s Sec',// 'EXIF_EXPOSURE' unit |
|
34 | + 'EXIF_EXPOSURE_EXP' => '%s Sec', // 'EXIF_EXPOSURE' unit |
|
35 | 35 | 'EXIF_EXPOSURE_BIAS' => 'Angle d’exposition', |
36 | - 'EXIF_EXPOSURE_BIAS_EXP' => '%s EV',// 'EXIF_EXPOSURE_BIAS' unit |
|
36 | + 'EXIF_EXPOSURE_BIAS_EXP' => '%s EV', // 'EXIF_EXPOSURE_BIAS' unit |
|
37 | 37 | 'EXIF_EXPOSURE_PROG' => 'Programme d’exposition', |
38 | 38 | 'EXIF_EXPOSURE_PROG_0' => 'Non défini', |
39 | 39 | 'EXIF_EXPOSURE_PROG_1' => 'Manuel', |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | 'EXIF_FLASH_CASE_93' => 'Flash déclenché, mode automatique, avec retour de lumière non détecté, yeux rouges réduits', |
74 | 74 | 'EXIF_FLASH_CASE_95' => 'Flash déclenché, mode automatique, avec retour de lumière détecté, yeux rouges réduits', |
75 | 75 | 'EXIF_FOCAL' => 'Longueur de focale', |
76 | - 'EXIF_FOCAL_EXP' => '%s mm',// 'EXIF_FOCAL' unit |
|
76 | + 'EXIF_FOCAL_EXP' => '%s mm', // 'EXIF_FOCAL' unit |
|
77 | 77 | 'EXIF_ISO' => 'Sensibilité ISO', |
78 | 78 | 'EXIF_METERING_MODE' => 'Mode de mesure', |
79 | 79 | 'EXIF_METERING_MODE_0' => 'Inconnu', |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
143 | - * Delete reports for given report_ids |
|
144 | - * |
|
145 | - * @param mixed $report_ids Array or integer with report_id. |
|
146 | - */ |
|
143 | + * Delete reports for given report_ids |
|
144 | + * |
|
145 | + * @param mixed $report_ids Array or integer with report_id. |
|
146 | + */ |
|
147 | 147 | public function delete($report_ids) |
148 | 148 | { |
149 | 149 | $report_ids = self::cast_mixed_int2array($report_ids); |
@@ -163,10 +163,10 @@ discard block |
||
163 | 163 | |
164 | 164 | |
165 | 165 | /** |
166 | - * Delete reports for given image_ids |
|
167 | - * |
|
168 | - * @param mixed $image_ids Array or integer with image_id. |
|
169 | - */ |
|
166 | + * Delete reports for given image_ids |
|
167 | + * |
|
168 | + * @param mixed $image_ids Array or integer with image_id. |
|
169 | + */ |
|
170 | 170 | public function delete_images($image_ids) |
171 | 171 | { |
172 | 172 | $image_ids = self::cast_mixed_int2array($image_ids); |
@@ -194,10 +194,10 @@ discard block |
||
194 | 194 | |
195 | 195 | |
196 | 196 | /** |
197 | - * Delete reports for given album_ids |
|
198 | - * |
|
199 | - * @param mixed $album_ids Array or integer with album_id. |
|
200 | - */ |
|
197 | + * Delete reports for given album_ids |
|
198 | + * |
|
199 | + * @param mixed $album_ids Array or integer with album_id. |
|
200 | + */ |
|
201 | 201 | public function delete_albums($album_ids) |
202 | 202 | { |
203 | 203 | $album_ids = self::cast_mixed_int2array($album_ids); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | const LOCKED = 2; |
23 | 23 | |
24 | 24 | public function __construct(\phpbbgallery\core\log $gallery_log, \phpbbgallery\core\auth\auth $gallery_auth, \phpbb\user $user, |
25 | - \phpbb\language\language $language, \phpbb\db\driver\driver_interface $db, \phpbb\user_loader $user_loader, |
|
25 | + \phpbb\language\language $language, \phpbb\db\driver\driver_interface $db, \phpbb\user_loader $user_loader, |
|
26 | 26 | \phpbbgallery\core\album\album $album, \phpbb\template\template $template, \phpbb\controller\helper $helper, |
27 | 27 | \phpbbgallery\core\config $gallery_config, \phpbb\pagination $pagination, \phpbbgallery\core\notification\helper $notification_helper, |
28 | 28 | $images_table, $reports_table) |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | 'REPORT_TIME' => $this->user->format_date($VAR['report_time']), |
322 | 322 | )); |
323 | 323 | unset($album_tmp); |
324 | - $reported_images_count ++; |
|
324 | + $reported_images_count++; |
|
325 | 325 | } |
326 | 326 | $this->template->assign_vars(array( |
327 | 327 | 'TOTAL_IMAGES_REPORTED' => $status == 1 ? $this->language->lang('WAITING_REPORTED_IMAGE', (int) $count) : $this->language->lang('WAITING_REPORTED_DONE', (int) $count), |
@@ -249,8 +249,7 @@ discard block |
||
249 | 249 | { |
250 | 250 | $mod_array[] = 0; |
251 | 251 | } |
252 | - } |
|
253 | - else |
|
252 | + } else |
|
254 | 253 | { |
255 | 254 | $mod_array = array($album); |
256 | 255 | } |
@@ -340,8 +339,7 @@ discard block |
||
340 | 339 | $this->template->assign_vars(array( |
341 | 340 | 'TOTAL_PAGES' => $this->language->lang('PAGE_TITLE_NUMBER', $page + 1), |
342 | 341 | )); |
343 | - } |
|
344 | - else |
|
342 | + } else |
|
345 | 343 | { |
346 | 344 | $this->pagination->generate_template_pagination(array( |
347 | 345 | 'routes' => array( |
@@ -396,8 +394,7 @@ discard block |
||
396 | 394 | if (is_array($ids)) |
397 | 395 | { |
398 | 396 | return array_map('intval', $ids); |
399 | - } |
|
400 | - else |
|
397 | + } else |
|
401 | 398 | { |
402 | 399 | return array((int) $ids); |
403 | 400 | } |
@@ -13,24 +13,24 @@ discard block |
||
13 | 13 | class upload |
14 | 14 | { |
15 | 15 | /** |
16 | - * Number of Files per Directory |
|
17 | - * |
|
18 | - * If this constant is set to a value >0 the gallery will create a new directory, |
|
19 | - * when the current directory has more files in it than set here. |
|
20 | - */ |
|
16 | + * Number of Files per Directory |
|
17 | + * |
|
18 | + * If this constant is set to a value >0 the gallery will create a new directory, |
|
19 | + * when the current directory has more files in it than set here. |
|
20 | + */ |
|
21 | 21 | const NUM_FILES_PER_DIR = 0; |
22 | 22 | |
23 | 23 | /** |
24 | - * Objects: phpBB Upload, 2 Files and Image-Functions |
|
25 | - */ |
|
24 | + * Objects: phpBB Upload, 2 Files and Image-Functions |
|
25 | + */ |
|
26 | 26 | private $upload = null; |
27 | 27 | private $file = null; |
28 | 28 | private $zip_file = null; |
29 | 29 | //private $tools = null; |
30 | 30 | |
31 | 31 | /** |
32 | - * Basic variables... |
|
33 | - */ |
|
32 | + * Basic variables... |
|
33 | + */ |
|
34 | 34 | public $loaded_files = 0; |
35 | 35 | public $uploaded_files = 0; |
36 | 36 | public $errors = array(); |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
161 | - * Upload a zip file and save the images into the import/ directory. |
|
162 | - */ |
|
161 | + * Upload a zip file and save the images into the import/ directory. |
|
162 | + */ |
|
163 | 163 | public function upload_zip() |
164 | 164 | { |
165 | 165 | if (!class_exists('compress_zip')) |
@@ -307,14 +307,14 @@ discard block |
||
307 | 307 | $file_link = $this->gallery_url->path('upload') . $this->image_data[$image_id]['image_filename']; |
308 | 308 | |
309 | 309 | /** |
310 | - * Event upload image before |
|
311 | - * |
|
312 | - * @event phpbbgallery.core.upload.update_image_before |
|
313 | - * @var array additional_sql_data array of additional settings |
|
314 | - * @var array image_data array of image_data |
|
315 | - * @var string file_link link to file |
|
316 | - * @since 1.2.0 |
|
317 | - */ |
|
310 | + * Event upload image before |
|
311 | + * |
|
312 | + * @event phpbbgallery.core.upload.update_image_before |
|
313 | + * @var array additional_sql_data array of additional settings |
|
314 | + * @var array image_data array of image_data |
|
315 | + * @var string file_link link to file |
|
316 | + * @since 1.2.0 |
|
317 | + */ |
|
318 | 318 | $vars = array('additional_sql_data', 'image_data', 'file_link'); |
319 | 319 | extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.upload.update_image_before', compact($vars))); |
320 | 320 | |
@@ -322,12 +322,12 @@ discard block |
||
322 | 322 | if (!$this->prepare_file_update($image_id)) |
323 | 323 | { |
324 | 324 | /** |
325 | - * Event upload image update |
|
326 | - * |
|
327 | - * @event phpbbgallery.core.upload.update_image_nofilechange |
|
328 | - * @var array additional_sql_data array of additional settings |
|
329 | - * @since 1.2.0 |
|
330 | - */ |
|
325 | + * Event upload image update |
|
326 | + * |
|
327 | + * @event phpbbgallery.core.upload.update_image_nofilechange |
|
328 | + * @var array additional_sql_data array of additional settings |
|
329 | + * @since 1.2.0 |
|
330 | + */ |
|
331 | 331 | $vars = array('additional_sql_data'); |
332 | 332 | extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.upload.update_image_nofilechange', compact($vars))); |
333 | 333 | } |
@@ -345,8 +345,8 @@ discard block |
||
345 | 345 | } |
346 | 346 | |
347 | 347 | /** |
348 | - * Prepare file on upload: rotate and resize |
|
349 | - */ |
|
348 | + * Prepare file on upload: rotate and resize |
|
349 | + */ |
|
350 | 350 | public function prepare_file() |
351 | 351 | { |
352 | 352 | $upload_dir = $this->get_current_upload_dir(); |
@@ -376,13 +376,13 @@ discard block |
||
376 | 376 | $file = $this->file; |
377 | 377 | |
378 | 378 | /** |
379 | - * Event upload image update |
|
380 | - * |
|
381 | - * @event phpbbgallery.core.upload.prepare_file_before |
|
382 | - * @var array additional_sql_data array of additional settings |
|
383 | - * @var array file File object |
|
384 | - * @since 1.2.0 |
|
385 | - */ |
|
379 | + * Event upload image update |
|
380 | + * |
|
381 | + * @event phpbbgallery.core.upload.prepare_file_before |
|
382 | + * @var array additional_sql_data array of additional settings |
|
383 | + * @var array file File object |
|
384 | + * @since 1.2.0 |
|
385 | + */ |
|
386 | 386 | $vars = array('additional_sql_data', 'file'); |
387 | 387 | extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.upload.prepare_file_before', compact($vars))); |
388 | 388 | |
@@ -729,8 +729,8 @@ discard block |
||
729 | 729 | } |
730 | 730 | |
731 | 731 | /** |
732 | - * Generate some kind of check so users only complete the uplaod for their images |
|
733 | - */ |
|
732 | + * Generate some kind of check so users only complete the uplaod for their images |
|
733 | + */ |
|
734 | 734 | public function generate_hidden_fields() |
735 | 735 | { |
736 | 736 | $checks = array(); |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | include_once($this->root_path . 'includes/message_parser.' . $this->php_ext); |
280 | 280 | } |
281 | 281 | $message_parser = new \parse_message(); |
282 | - $message_parser->message = utf8_normalize_nfc($this->get_description()); |
|
282 | + $message_parser->message = utf8_normalize_nfc($this->get_description()); |
|
283 | 283 | if ($message_parser->message) |
284 | 284 | { |
285 | 285 | $message_parser->parse(true, true, true, true, false, true, true, true); |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | |
335 | 335 | $sql_ary = array_merge($sql_ary, $additional_sql_data); |
336 | 336 | |
337 | - $sql = 'UPDATE ' . $this->images_table. ' |
|
337 | + $sql = 'UPDATE ' . $this->images_table . ' |
|
338 | 338 | SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
339 | 339 | WHERE image_id = ' . (int) $image_id; |
340 | 340 | $this->db->sql_query($sql); |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | // Rotate the image |
453 | 453 | if ($this->gallery_config->get('allow_rotate') && $this->get_rotating()) |
454 | 454 | { |
455 | - $this->tools->rotate_image($this->get_rotating(),$this->gallery_config->get('allow_resize')); |
|
455 | + $this->tools->rotate_image($this->get_rotating(), $this->gallery_config->get('allow_resize')); |
|
456 | 456 | if ($this->tools->rotated) |
457 | 457 | { |
458 | 458 | $this->tools->write_image($this->tools->image_source, $this->gallery_config->get('jpg_quality'), true); |
@@ -144,8 +144,7 @@ discard block |
||
144 | 144 | { |
145 | 145 | $this->zip_file = $this->file; |
146 | 146 | $this->upload_zip(); |
147 | - } |
|
148 | - else |
|
147 | + } else |
|
149 | 148 | { |
150 | 149 | $image_id = $this->prepare_file(); |
151 | 150 | if ($image_id) |
@@ -210,8 +209,7 @@ discard block |
||
210 | 209 | if (is_dir($current_dir . $file)) |
211 | 210 | { |
212 | 211 | $this->read_zip_folder($current_dir . $file . '/'); |
213 | - } |
|
214 | - else if (in_array(utf8_substr(strtolower($file), utf8_strrpos($file, '.') + 1), self::get_allowed_types(false, true))) |
|
212 | + } else if (in_array(utf8_substr(strtolower($file), utf8_strrpos($file, '.') + 1), self::get_allowed_types(false, true))) |
|
215 | 213 | { |
216 | 214 | if (!$this->file_limit || ($this->uploaded_files < $this->file_limit)) |
217 | 215 | { |
@@ -231,23 +229,20 @@ discard block |
||
231 | 229 | { |
232 | 230 | $this->uploaded_files++; |
233 | 231 | $this->images[] = (int) $image_id; |
234 | - } |
|
235 | - else |
|
232 | + } else |
|
236 | 233 | { |
237 | 234 | if ($this->file->error) |
238 | 235 | { |
239 | 236 | $this->new_error($this->language->lang('UPLOAD_ERROR', $this->file->get('uploadname'), implode('<br />» ', $this->file->error))); |
240 | 237 | } |
241 | 238 | } |
242 | - } |
|
243 | - else |
|
239 | + } else |
|
244 | 240 | { |
245 | 241 | $this->quota_error(); |
246 | 242 | @unlink($current_dir . $file); |
247 | 243 | } |
248 | 244 | |
249 | - } |
|
250 | - else |
|
245 | + } else |
|
251 | 246 | { |
252 | 247 | @unlink($current_dir . $file); |
253 | 248 | } |
@@ -356,8 +351,7 @@ discard block |
||
356 | 351 | { |
357 | 352 | $this->file->clean_filename('unique_ext'); |
358 | 353 | $this->file->move_file(substr($this->gallery_url->path('upload'), 0, -1), false, false, CHMOD_ALL); |
359 | - } |
|
360 | - else |
|
354 | + } else |
|
361 | 355 | { |
362 | 356 | // Okay, this looks hacky, but what we do here is, we store the directory name in the filename. |
363 | 357 | // However phpBB strips directories form the filename, when moving, so we need to specify that again. |
@@ -411,8 +405,7 @@ discard block |
||
411 | 405 | //$this->file->height = $this->tools->image_size['height']; |
412 | 406 | //$this->file->width = $this->tools->image_size['width']; |
413 | 407 | } |
414 | - } |
|
415 | - else |
|
408 | + } else |
|
416 | 409 | { |
417 | 410 | $this->file->remove(); |
418 | 411 | $this->new_error($this->language->lang('UPLOAD_ERROR', $this->file->get('uploadname'), $this->language->lang('UPLOAD_IMAGE_SIZE_TOO_BIG'))); |
@@ -34,18 +34,18 @@ discard block |
||
34 | 34 | const NUM_IMAGES = 3; |
35 | 35 | |
36 | 36 | /** |
37 | - * There are different modes to calculate who won the contest. |
|
38 | - * This value should be one of the constant-names below. |
|
39 | - */ |
|
37 | + * There are different modes to calculate who won the contest. |
|
38 | + * This value should be one of the constant-names below. |
|
39 | + */ |
|
40 | 40 | static public $mode = self::MODE_AVERAGE; |
41 | 41 | |
42 | 42 | /** |
43 | - * The image with the highest average wins. |
|
44 | - */ |
|
43 | + * The image with the highest average wins. |
|
44 | + */ |
|
45 | 45 | const MODE_AVERAGE = 1; |
46 | 46 | /** |
47 | - * The image with the highest number of total points wins. |
|
48 | - */ |
|
47 | + * The image with the highest number of total points wins. |
|
48 | + */ |
|
49 | 49 | const MODE_SUM = 2; |
50 | 50 | |
51 | 51 | public function __construct(\phpbb\db\driver\driver_interface $db, |
@@ -59,14 +59,14 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | - * Get the contest row from the table |
|
63 | - * |
|
64 | - * @param int $id ID of the contest or album, depending on second parameter |
|
65 | - * @param string $mode contest or album ID to get the contest. |
|
66 | - * @param bool $throw_error Shall we throw an error if the contest was not found? |
|
67 | - * |
|
68 | - * @return mixed Either the array or boolean false if contest does not exist |
|
69 | - */ |
|
62 | + * Get the contest row from the table |
|
63 | + * |
|
64 | + * @param int $id ID of the contest or album, depending on second parameter |
|
65 | + * @param string $mode contest or album ID to get the contest. |
|
66 | + * @param bool $throw_error Shall we throw an error if the contest was not found? |
|
67 | + * |
|
68 | + * @return mixed Either the array or boolean false if contest does not exist |
|
69 | + */ |
|
70 | 70 | public function get_contest($id, $mode = 'contest', $throw_error = true) |
71 | 71 | { |
72 | 72 | $sql = 'SELECT * |
@@ -190,9 +190,9 @@ |
||
190 | 190 | $this->db->sql_freeresult($result); |
191 | 191 | |
192 | 192 | $sql = 'UPDATE ' . $this->contest_table . ' |
193 | - SET contest_first = ' . (int) $first .', |
|
194 | - contest_second = ' . (int) $second .', |
|
195 | - contest_third = ' . (int) $third .' |
|
193 | + SET contest_first = ' . (int) $first . ', |
|
194 | + contest_second = ' . (int) $second . ', |
|
195 | + contest_third = ' . (int) $third . ' |
|
196 | 196 | WHERE contest_album_id = ' . (int) $album_id; |
197 | 197 | $this->db->sql_query($sql); |
198 | 198 |
@@ -165,8 +165,7 @@ |
||
165 | 165 | { |
166 | 166 | $this->resync($album_id); |
167 | 167 | } |
168 | - } |
|
169 | - else |
|
168 | + } else |
|
170 | 169 | { |
171 | 170 | $this->resync((int) $album_ids); |
172 | 171 | } |