Version Description
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 6.7.12 |
Comparing to | |
See all releases |
Code changes from version 6.7.11 to 6.7.12
- readme.txt +14 -2
- wppa-exif-iptc-common.php +489 -198
- wppa-functions.php +5 -6
- wppa-picture.php +2 -2
- wppa-settings-autosave.php +5 -1
- wppa-tinymce-photo-front.php +3 -8
- wppa.php +3 -3
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
-
Version: 6.7.
|
6 |
-
Stable tag: 6.7.
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
@@ -127,6 +127,18 @@ If this happens, make sure (ask your hosting provider) that you have all the rig
|
|
127 |
|
128 |
See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
= 6.7.11 =
|
131 |
|
132 |
= Bug Fixes =
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
+
Version: 6.7.12
|
6 |
+
Stable tag: 6.7.11
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
127 |
|
128 |
See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
|
129 |
|
130 |
+
= 6.7.12 =
|
131 |
+
|
132 |
+
= Bug Fixes =
|
133 |
+
|
134 |
+
* Various minor fixes for PHP 7.1 compatibility.
|
135 |
+
* Exif tags are now formatted when used as keywords.
|
136 |
+
|
137 |
+
= Other Changes =
|
138 |
+
|
139 |
+
* If Table IX-L5 is set to html, the html defaults to type sphoto.
|
140 |
+
* Improved formatting of various exif tags.
|
141 |
+
|
142 |
= 6.7.11 =
|
143 |
|
144 |
= Bug Fixes =
|
wppa-exif-iptc-common.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* exif and iptc common functions
|
6 |
-
* version 6.7.
|
7 |
*
|
8 |
*
|
9 |
*/
|
@@ -127,13 +127,13 @@ global $wppa_exif_cache;
|
|
127 |
|
128 |
$tag = $exifline['tag'];
|
129 |
if ( $prevtag == $tag ) { // add a next item for this tag
|
130 |
-
$combined .= ', '.
|
131 |
}
|
132 |
else { // first item of this tag
|
133 |
if ( $combined ) { // Process if required
|
134 |
$temp = str_replace( $prevtag, $combined, $temp );
|
135 |
}
|
136 |
-
$combined =
|
137 |
$prevtag = $tag;
|
138 |
}
|
139 |
}
|
@@ -158,7 +158,7 @@ global $wppa_exif_cache;
|
|
158 |
// Remove untranslated
|
159 |
$pos = strpos($temp, 'E#');
|
160 |
while ( $pos !== false ) {
|
161 |
-
$tmp = substr($temp, 0, $pos).__('n.a.', 'wp-photo-album-plus').substr($temp, $pos+6);
|
162 |
$temp = $tmp;
|
163 |
$pos = strpos($temp, 'E#');
|
164 |
}
|
@@ -167,212 +167,503 @@ global $wppa_exif_cache;
|
|
167 |
return $temp;
|
168 |
}
|
169 |
|
170 |
-
function wppa_format_exif($tag, $data) {
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
E#
|
177 |
-
E#
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
2#095 State
|
182 |
-
2#101 Country
|
183 |
-
|
184 |
-
E#0110 Camera Already formatted correctly Example: Canon EOS 50D
|
185 |
-
aux:Lens Lens Already formatted correctly - See line 66 in sample photo exifdata.jpg attached Example aux:Lens="EF300mm f/4L IS USM +1.4x"
|
186 |
-
*/
|
187 |
-
// E#920A Focal length Must be formatted: 420/1 = 420 mm
|
188 |
-
case 'E#920A':
|
189 |
-
$temp = explode('/', $data);
|
190 |
-
if (isset($temp[1])) {
|
191 |
-
if (is_numeric($temp[1])) {
|
192 |
-
if ($temp[1] != 0) $result = round($temp[0]/$temp[1]).' mm.';
|
193 |
}
|
194 |
-
}
|
195 |
-
break;
|
196 |
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
|
|
|
|
|
|
|
|
|
|
203 |
}
|
204 |
-
}
|
205 |
-
break;
|
206 |
|
207 |
-
//
|
208 |
-
|
209 |
-
|
210 |
-
|
|
|
|
|
|
|
|
|
211 |
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
if ($temp[1] != 0) $result = 'f/'.(round(10*$temp[0]/$temp[1])/10);
|
218 |
}
|
219 |
-
}
|
220 |
-
break;
|
221 |
-
/*
|
222 |
-
E#8827 ISO Speed Rating Already formatted correctly
|
223 |
-
E#9204 Exposure bias Already formatted correctly
|
224 |
-
|
225 |
-
E#8822 Exposure program Must be formatted according to table
|
226 |
-
0 = Not Defined
|
227 |
-
1 = Manual
|
228 |
-
2 = Program AE
|
229 |
-
3 = Aperture-priority AE
|
230 |
-
4 = Shutter speed priority AE
|
231 |
-
5 = Creative (Slow speed)
|
232 |
-
6 = Action (High speed)
|
233 |
-
7 = Portrait
|
234 |
-
8 = Landscape
|
235 |
-
9 = Bulb
|
236 |
-
*/
|
237 |
-
case 'E#8822':
|
238 |
-
switch ($data) {
|
239 |
-
case '0': $result = __('Not Defined', 'wp-photo-album-plus'); break;
|
240 |
-
case '1': $result = __('Manual', 'wp-photo-album-plus'); break;
|
241 |
-
case '2': $result = __('Program AE', 'wp-photo-album-plus'); break;
|
242 |
-
case '3': $result = __('Aperture-priority AE', 'wp-photo-album-plus'); break;
|
243 |
-
case '4': $result = __('Shutter speed priority AE', 'wp-photo-album-plus'); break;
|
244 |
-
case '5': $result = __('Creative (Slow speed)', 'wp-photo-album-plus'); break;
|
245 |
-
case '6': $result = __('Action (High speed)', 'wp-photo-album-plus'); break;
|
246 |
-
case '7': $result = __('Portrait', 'wp-photo-album-plus'); break;
|
247 |
-
case '8': $result = __('Landscape', 'wp-photo-album-plus'); break;
|
248 |
-
case '9': $result = __('Bulb', 'wp-photo-album-plus'); break;
|
249 |
-
}
|
250 |
-
break;
|
251 |
-
/*
|
252 |
-
E#9204 Exposure bias value
|
253 |
-
*/
|
254 |
-
case 'E#9204':
|
255 |
-
if ( $data) $result = $data.' EV';
|
256 |
-
else $result = '';
|
257 |
-
break;
|
258 |
-
/*
|
259 |
-
E#9207 Metering mode Must be formatted according to table
|
260 |
-
1 = Average
|
261 |
-
2 = Center-weighted average
|
262 |
-
3 = Spot
|
263 |
-
4 = Multi-spot
|
264 |
-
5 = Multi-segment
|
265 |
-
6 = Partial
|
266 |
-
255 = Other
|
267 |
-
*/
|
268 |
-
case 'E#9207':
|
269 |
-
switch ($data) {
|
270 |
-
case '1': $result = __('Average', 'wp-photo-album-plus'); break;
|
271 |
-
case '2': $result = __('Center-weighted average', 'wp-photo-album-plus'); break;
|
272 |
-
case '3': $result = __('Spot', 'wp-photo-album-plus'); break;
|
273 |
-
case '4': $result = __('Multi-spot', 'wp-photo-album-plus'); break;
|
274 |
-
case '5': $result = __('Multi-segment', 'wp-photo-album-plus'); break;
|
275 |
-
case '6': $result = __('Partial', 'wp-photo-album-plus'); break;
|
276 |
-
case '255': $result = __('Other', 'wp-photo-album-plus'); break;
|
277 |
-
}
|
278 |
-
break;
|
279 |
-
/*
|
280 |
-
E#9209 Flash Must be formatted according to table
|
281 |
-
0x0 = No Flash
|
282 |
-
0x1 = Fired
|
283 |
-
0x5 = Fired, Return not detected
|
284 |
-
0x7 = Fired, Return detected
|
285 |
-
0x8 = On, Did not fire
|
286 |
-
0x9 = On, Fired
|
287 |
-
0xd = On, Return not detected
|
288 |
-
0xf = On, Return detected
|
289 |
-
0x10 = Off, Did not fire
|
290 |
-
0x14 = Off, Did not fire, Return not detected
|
291 |
-
0x18 = Auto, Did not fire
|
292 |
-
0x19 = Auto, Fired
|
293 |
-
0x1d = Auto, Fired, Return not detected
|
294 |
-
0x1f = Auto, Fired, Return detected
|
295 |
-
0x20 = No flash function
|
296 |
-
0x30 = Off, No flash function
|
297 |
-
0x41 = Fired, Red-eye reduction
|
298 |
-
0x45 = Fired, Red-eye reduction, Return not detected
|
299 |
-
0x47 = Fired, Red-eye reduction, Return detected
|
300 |
-
0x49 = On, Red-eye reduction
|
301 |
-
0x4d = On, Red-eye reduction, Return not detected
|
302 |
-
0x4f = On, Red-eye reduction, Return detected
|
303 |
-
0x50 = Off, Red-eye reduction
|
304 |
-
0x58 = Auto, Did not fire, Red-eye reduction
|
305 |
-
0x59 = Auto, Fired, Red-eye reduction
|
306 |
-
0x5d = Auto, Fired, Red-eye reduction, Return not detected
|
307 |
-
0x5f = Auto, Fired, Red-eye reduction, Return detected
|
308 |
-
*/
|
309 |
-
case 'E#9209':
|
310 |
-
// PHP7 '0x0' etc generates warning because octal strings are no longer suppported, but they are real strings here
|
311 |
-
switch ($data) {
|
312 |
-
case '0'.'x0':
|
313 |
-
case '0': $result = __('No Flash', 'wp-photo-album-plus'); break;
|
314 |
-
case '0'.'x1':
|
315 |
-
case '1': $result = __('Fired', 'wp-photo-album-plus'); break;
|
316 |
-
case '0'.'x5':
|
317 |
-
case '5': $result = __('Fired, Return not detected', 'wp-photo-album-plus'); break;
|
318 |
-
case '0'.'x7':
|
319 |
-
case '7': $result = __('Fired, Return detected', 'wp-photo-album-plus'); break;
|
320 |
-
case '0'.'x8':
|
321 |
-
case '8': $result = __('On, Did not fire', 'wp-photo-album-plus'); break;
|
322 |
-
case '0'.'x9':
|
323 |
-
case '9': $result = __('On, Fired', 'wp-photo-album-plus'); break;
|
324 |
-
case '0'.'xd':
|
325 |
-
case '13': $result = __('On, Return not detected', 'wp-photo-album-plus'); break;
|
326 |
-
case '0'.'xf':
|
327 |
-
case '15': $result = __('On, Return detected', 'wp-photo-album-plus'); break;
|
328 |
-
case '0'.'x10':
|
329 |
-
case '16': $result = __('Off, Did not fire', 'wp-photo-album-plus'); break;
|
330 |
-
case '0'.'x14':
|
331 |
-
case '20': $result = __('Off, Did not fire, Return not detected', 'wp-photo-album-plus'); break;
|
332 |
-
case '0'.'x18':
|
333 |
-
case '24': $result = __('Auto, Did not fire', 'wp-photo-album-plus'); break;
|
334 |
-
case '0'.'x19':
|
335 |
-
case '25': $result = __('Auto, Fired', 'wp-photo-album-plus'); break;
|
336 |
-
case '0'.'x1d':
|
337 |
-
case '29': $result = __('Auto, Fired, Return not detected', 'wp-photo-album-plus'); break;
|
338 |
-
case '0'.'x1f':
|
339 |
-
case '31': $result = __('Auto, Fired, Return detected', 'wp-photo-album-plus'); break;
|
340 |
-
case '0'.'x20':
|
341 |
-
case '32': $result = __('No flash function', 'wp-photo-album-plus'); break;
|
342 |
-
case '0'.'x30':
|
343 |
-
case '48': $result = __('Off, No flash function', 'wp-photo-album-plus'); break;
|
344 |
-
case '0'.'x41':
|
345 |
-
case '65': $result = __('Fired, Red-eye reduction', 'wp-photo-album-plus'); break;
|
346 |
-
case '0'.'x45':
|
347 |
-
case '69': $result = __('Fired, Red-eye reduction, Return not detected', 'wp-photo-album-plus'); break;
|
348 |
-
case '0'.'x47':
|
349 |
-
case '71': $result = __('Fired, Red-eye reduction, Return detected', 'wp-photo-album-plus'); break;
|
350 |
-
case '0'.'x49':
|
351 |
-
case '73': $result = __('On, Red-eye reduction', 'wp-photo-album-plus'); break;
|
352 |
-
case '0'.'x4d':
|
353 |
-
case '77': $result = __('Red-eye reduction, Return not detected', 'wp-photo-album-plus'); break;
|
354 |
-
case '0'.'x4f':
|
355 |
-
case '79': $result = __('On, Red-eye reduction, Return detected', 'wp-photo-album-plus'); break;
|
356 |
-
case '0'.'x50':
|
357 |
-
case '80': $result = __('Off, Red-eye reduction', 'wp-photo-album-plus'); break;
|
358 |
-
case '0'.'x58':
|
359 |
-
case '88': $result = __('Auto, Did not fire, Red-eye reduction', 'wp-photo-album-plus'); break;
|
360 |
-
case '0'.'x59':
|
361 |
-
case '89': $result = __('Auto, Fired, Red-eye reduction', 'wp-photo-album-plus'); break;
|
362 |
-
case '0'.'x5d':
|
363 |
-
case '93': $result = __('Auto, Fired, Red-eye reduction, Return not detected', 'wp-photo-album-plus'); break;
|
364 |
-
case '0'.'x5f':
|
365 |
-
case '95': $result = __('Auto, Fired, Red-eye reduction, Return detected', 'wp-photo-album-plus'); break;
|
366 |
-
}
|
367 |
-
break;
|
368 |
|
369 |
-
|
370 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
371 |
}
|
372 |
|
373 |
return $result;
|
374 |
}
|
375 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
function wppa_iptc_clean_garbage( $photo ) {
|
377 |
global $wpdb;
|
378 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* exif and iptc common functions
|
6 |
+
* version 6.7.12
|
7 |
*
|
8 |
*
|
9 |
*/
|
127 |
|
128 |
$tag = $exifline['tag'];
|
129 |
if ( $prevtag == $tag ) { // add a next item for this tag
|
130 |
+
$combined .= ', ' . wppa_format_exif( $tag, $exifline['description'] );
|
131 |
}
|
132 |
else { // first item of this tag
|
133 |
if ( $combined ) { // Process if required
|
134 |
$temp = str_replace( $prevtag, $combined, $temp );
|
135 |
}
|
136 |
+
$combined = wppa_format_exif( $tag, $exifline['description'] );
|
137 |
$prevtag = $tag;
|
138 |
}
|
139 |
}
|
158 |
// Remove untranslated
|
159 |
$pos = strpos($temp, 'E#');
|
160 |
while ( $pos !== false ) {
|
161 |
+
$tmp = substr( $temp, 0, $pos ) . '<span title="' . esc_attr( __( 'No data', 'wp-photo-album-plus' ) ) . '">' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>' . substr( $temp, $pos+6 );
|
162 |
$temp = $tmp;
|
163 |
$pos = strpos($temp, 'E#');
|
164 |
}
|
167 |
return $temp;
|
168 |
}
|
169 |
|
170 |
+
function wppa_format_exif( $tag, $data ) {
|
171 |
+
global $wppa_exif_error_output;
|
172 |
+
|
173 |
+
if ( $data ) {
|
174 |
+
switch ( $tag ) {
|
175 |
+
|
176 |
+
case 'E#0100': // Image width (pixels), Short or long, 1 item
|
177 |
+
case 'E#0101': // Image length (pixels), Short or long, 1 item
|
178 |
+
|
179 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
180 |
+
return $wppa_exif_error_output;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
}
|
|
|
|
|
182 |
|
183 |
+
$result = $data . ' ' . __( 'px.', 'wp-photo-album-plus' );
|
184 |
+
return $result;
|
185 |
+
break;
|
186 |
+
|
187 |
+
// E#0110 Camera Already formatted correctly Example: Canon EOS 50D
|
188 |
+
|
189 |
+
case 'E#011A': // XResolution
|
190 |
+
case 'E#011B': // YResolution
|
191 |
+
|
192 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
193 |
+
return $wppa_exif_error_output;
|
194 |
}
|
|
|
|
|
195 |
|
196 |
+
// Format is valid
|
197 |
+
$temp = explode( '/', $data );
|
198 |
+
$x = $temp[0];
|
199 |
+
$y = $temp[1];
|
200 |
+
|
201 |
+
$result = ( $x / $y );
|
202 |
+
return $result;
|
203 |
+
break;
|
204 |
|
205 |
+
case 'E#0128': // Resolution unit
|
206 |
+
case 'E#A210': // FocalPlaneResolutionUnit
|
207 |
+
|
208 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
209 |
+
return $wppa_exif_error_output;
|
|
|
210 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
|
212 |
+
switch ( $data ) {
|
213 |
+
case 2:
|
214 |
+
$result = __( 'inches', 'wp-photo-album-plus' );
|
215 |
+
break;
|
216 |
+
case 3:
|
217 |
+
$result = __( 'centimeters', 'wp-photo-album-plus' );
|
218 |
+
break;
|
219 |
+
default:
|
220 |
+
$result = __( 'reserved', 'wp-photo-album-plus' );
|
221 |
+
}
|
222 |
+
return $result;
|
223 |
+
break;
|
224 |
+
|
225 |
+
// E#0132 Date Time Already formatted correctly
|
226 |
+
// E#013B Photographer Already formatted correctly
|
227 |
+
|
228 |
+
case 'E#A20E': // FocalPlaneXResolution
|
229 |
+
case 'E#A20F': // FocalPlaneYResolution
|
230 |
+
|
231 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
232 |
+
return $wppa_exif_error_output;
|
233 |
+
}
|
234 |
+
|
235 |
+
// Format is valid
|
236 |
+
$temp = explode( '/', $data );
|
237 |
+
$x = $temp[0];
|
238 |
+
$y = $temp[1];
|
239 |
+
|
240 |
+
$result = round( $x / $y );
|
241 |
+
return $result;
|
242 |
+
break;
|
243 |
+
|
244 |
+
case 'E#0213': // YCbCrPositioning
|
245 |
+
|
246 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
247 |
+
return $wppa_exif_error_output;
|
248 |
+
}
|
249 |
+
|
250 |
+
switch ( $data ) {
|
251 |
+
case 1:
|
252 |
+
$result = __( 'centered', 'wp-photo-album-plus' );
|
253 |
+
break;
|
254 |
+
case 2:
|
255 |
+
$result = __( 'co-sited', 'wp-photo-album-plus' );
|
256 |
+
break;
|
257 |
+
default:
|
258 |
+
$result = __( 'reserved', 'wp-photo-album-plus' );
|
259 |
+
}
|
260 |
+
|
261 |
+
return $result;
|
262 |
+
break;
|
263 |
+
|
264 |
+
case 'E#9201': // Shutter speed value
|
265 |
+
|
266 |
+
if ( ! wppa_is_valid_rational( $data, true ) ) {
|
267 |
+
return $wppa_exif_error_output;
|
268 |
+
}
|
269 |
+
|
270 |
+
// Format is valid
|
271 |
+
$temp = explode( '/', $data );
|
272 |
+
$x = $temp[0];
|
273 |
+
$y = $temp[1];
|
274 |
+
|
275 |
+
$result = round( 10 * $x / $y ) / 10;
|
276 |
+
return $result;
|
277 |
+
break;
|
278 |
+
|
279 |
+
|
280 |
+
/*
|
281 |
+
E#8298 Copyright Already formatted correctly
|
282 |
+
Location Formatted into one line according to the 3 tags below: 2#092, 2#090, 2#095, 2#101
|
283 |
+
2#092 Sub location
|
284 |
+
2#090 City
|
285 |
+
2#095 State
|
286 |
+
2#101 Country
|
287 |
+
|
288 |
+
aux:Lens Lens Already formatted correctly - See line 66 in sample photo exifdata.jpg attached Example aux:Lens="EF300mm f/4L IS USM +1.4x"
|
289 |
+
*/
|
290 |
+
// E#920A Focal length Must be formatted: 420/1 = 420 mm
|
291 |
+
case 'E#920A':
|
292 |
+
|
293 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
294 |
+
return $wppa_exif_error_output;
|
295 |
+
}
|
296 |
+
|
297 |
+
// Format is valid
|
298 |
+
$temp = explode( '/', $data );
|
299 |
+
$x = $temp[0];
|
300 |
+
$y = $temp[1];
|
301 |
+
|
302 |
+
$z = round( $x / $y );
|
303 |
+
if ( $z < 10 ) {
|
304 |
+
$result = round( $x * 10 / $y ) / 10 . ' mm.';
|
305 |
+
}
|
306 |
+
else {
|
307 |
+
$result = round( $x / $y ) . ' mm.';
|
308 |
+
}
|
309 |
+
return $result;
|
310 |
+
break;
|
311 |
+
|
312 |
+
// E#9206 Subject distance Must be formatted: 765/100 = 7,65 m.
|
313 |
+
case 'E#9206':
|
314 |
+
|
315 |
+
// Invalid format?
|
316 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
317 |
+
return $wppa_exif_error_output;
|
318 |
+
}
|
319 |
+
|
320 |
+
// Format is valid
|
321 |
+
$temp = explode( '/', $data );
|
322 |
+
$x = $temp[0];
|
323 |
+
$y = $temp[1];
|
324 |
+
|
325 |
+
if ( $x == 0 || $y == 0 ) {
|
326 |
+
$result = '<span title="' . esc_attr( __( 'Impossible data', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
327 |
+
}
|
328 |
+
else {
|
329 |
+
if ( $temp[1] != 0 ) {
|
330 |
+
$result = round( 100*$temp[0]/$temp[1] ) / 100;
|
331 |
+
}
|
332 |
+
if ( $result == -1 || $result > 10000 ) {
|
333 |
+
$result = '∞';
|
334 |
+
}
|
335 |
+
else {
|
336 |
+
$result .= ' m.';
|
337 |
+
}
|
338 |
+
}
|
339 |
+
|
340 |
+
return $result;
|
341 |
+
break;
|
342 |
+
|
343 |
+
case 'E#829A': // Exposure time
|
344 |
+
|
345 |
+
// Invalid format?
|
346 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
347 |
+
return $wppa_exif_error_output;
|
348 |
+
}
|
349 |
+
|
350 |
+
// Format is valid
|
351 |
+
$temp = explode( '/', $data );
|
352 |
+
$x = $temp[0];
|
353 |
+
$y = $temp[1];
|
354 |
+
|
355 |
+
// 1 s.
|
356 |
+
if ( $x / $y == 1 ) {
|
357 |
+
$result = '1 s.';
|
358 |
+
return $result;
|
359 |
+
}
|
360 |
+
|
361 |
+
// Normal: 1/nn s.
|
362 |
+
if ( $x == 1 ) {
|
363 |
+
$result = $data . ' s.';
|
364 |
+
return $result;
|
365 |
+
}
|
366 |
+
|
367 |
+
// 'nn/1'
|
368 |
+
if ( $y == 1 ) {
|
369 |
+
$result = $x . ' s.';
|
370 |
+
return $result;
|
371 |
+
}
|
372 |
+
|
373 |
+
// Simplify nnn/mmm > 1
|
374 |
+
if ( ( $x / $y ) > 1 ) {
|
375 |
+
$result = sprintf( '%2.1f', $x / $y );
|
376 |
+
if ( substr( $result, -2 ) == '.0' ) { // Remove trailing '.0'
|
377 |
+
$result = substr( $result, 0, strlen( $result ) -2 ) . ' s.';
|
378 |
+
}
|
379 |
+
else {
|
380 |
+
$result .= ' s.';
|
381 |
+
}
|
382 |
+
return $result;
|
383 |
+
}
|
384 |
+
|
385 |
+
// Simplify nnn/mmm < 1
|
386 |
+
$v = $y / $x;
|
387 |
+
$z = round( $v ) / $v;
|
388 |
+
if ( 0.99 < $z && $z < 1.01 ) {
|
389 |
+
if ( round( $v ) == '1' ) {
|
390 |
+
$result = '1 s.';
|
391 |
+
}
|
392 |
+
else {
|
393 |
+
$result = '1/' . round( $v ) . ' s.';
|
394 |
+
}
|
395 |
+
}
|
396 |
+
else {
|
397 |
+
$z = $x / $y;
|
398 |
+
$i = 2;
|
399 |
+
$n = 0;
|
400 |
+
while ( $n < 2 && $i < strlen( $z ) ) {
|
401 |
+
if ( substr( $z, $i, 1 ) != '0' ) {
|
402 |
+
$n++;
|
403 |
+
}
|
404 |
+
$i++;
|
405 |
+
}
|
406 |
+
$result = substr( $z, 0, $i ) . ' s.';
|
407 |
+
}
|
408 |
+
return $result;
|
409 |
+
break;
|
410 |
+
|
411 |
+
case 'E#829D': // F-Stop
|
412 |
+
|
413 |
+
// Invalid format?
|
414 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
415 |
+
return $wppa_exif_error_output;
|
416 |
+
}
|
417 |
+
|
418 |
+
// Format is valid
|
419 |
+
$temp = explode( '/', $data );
|
420 |
+
$x = $temp[0];
|
421 |
+
$y = $temp[1];
|
422 |
+
|
423 |
+
// Bogus data?
|
424 |
+
if ( $x / $y > 100 ) {
|
425 |
+
$result = '<span title="' . esc_attr( __( 'Impossible data', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
426 |
+
return $result;
|
427 |
+
}
|
428 |
+
|
429 |
+
// Valid meaningful data
|
430 |
+
$result = 'f/' . ( round( 10 * $x / $y ) / 10 );
|
431 |
+
|
432 |
+
return $result;
|
433 |
+
break;
|
434 |
+
|
435 |
+
case 'E#9202': // Aperture value
|
436 |
+
case 'E#9205': // Max aperture value
|
437 |
+
|
438 |
+
// Invalid format?
|
439 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
440 |
+
return $wppa_exif_error_output;
|
441 |
+
}
|
442 |
+
|
443 |
+
// Format is valid
|
444 |
+
$temp = explode( '/', $data );
|
445 |
+
$x = $temp[0];
|
446 |
+
$y = $temp[1];
|
447 |
+
|
448 |
+
$result = round( 10 * $x / $y ) / 10;
|
449 |
+
|
450 |
+
return $result;
|
451 |
+
break;
|
452 |
+
|
453 |
+
/*
|
454 |
+
E#8827 ISO Speed Rating Already formatted correctly
|
455 |
+
E#9204 Exposure bias Already formatted correctly
|
456 |
+
*/
|
457 |
+
|
458 |
+
case 'E#8822': // Exposure program
|
459 |
+
switch ( $data ) {
|
460 |
+
case '0': $result = __('Not Defined', 'wp-photo-album-plus'); break;
|
461 |
+
case '1': $result = __('Manual', 'wp-photo-album-plus'); break;
|
462 |
+
case '2': $result = __('Program AE', 'wp-photo-album-plus'); break;
|
463 |
+
case '3': $result = __('Aperture-priority AE', 'wp-photo-album-plus'); break;
|
464 |
+
case '4': $result = __('Shutter speed priority AE', 'wp-photo-album-plus'); break;
|
465 |
+
case '5': $result = __('Creative (Slow speed)', 'wp-photo-album-plus'); break;
|
466 |
+
case '6': $result = __('Action (High speed)', 'wp-photo-album-plus'); break;
|
467 |
+
case '7': $result = __('Portrait', 'wp-photo-album-plus'); break;
|
468 |
+
case '8': $result = __('Landscape', 'wp-photo-album-plus'); break;
|
469 |
+
case '9': $result = __('Bulb', 'wp-photo-album-plus'); break;
|
470 |
+
default:
|
471 |
+
$result = '<span title="' . esc_attr( __( 'Unknown', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
472 |
+
}
|
473 |
+
return $result;
|
474 |
+
break;
|
475 |
+
|
476 |
+
case 'E#9204': // Exposure bias value
|
477 |
+
if ( $data ) $result = $data . ' EV';
|
478 |
+
else $result = '';
|
479 |
+
return $result;
|
480 |
+
break;
|
481 |
+
|
482 |
+
case 'E#9207': // Metering mode
|
483 |
+
switch ( $data ) {
|
484 |
+
case '1': $result = __('Average', 'wp-photo-album-plus'); break;
|
485 |
+
case '2': $result = __('Center-weighted average', 'wp-photo-album-plus'); break;
|
486 |
+
case '3': $result = __('Spot', 'wp-photo-album-plus'); break;
|
487 |
+
case '4': $result = __('Multi-spot', 'wp-photo-album-plus'); break;
|
488 |
+
case '5': $result = __('Multi-segment', 'wp-photo-album-plus'); break;
|
489 |
+
case '6': $result = __('Partial', 'wp-photo-album-plus'); break;
|
490 |
+
case '255': $result = __('Other', 'wp-photo-album-plus'); break;
|
491 |
+
default:
|
492 |
+
$result = '<span title="' . esc_attr( __( 'Unknown', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
493 |
+
}
|
494 |
+
return $result;
|
495 |
+
break;
|
496 |
+
|
497 |
+
case 'E#9209': // Flash
|
498 |
+
// PHP7 '0x0' etc generates warning because octal strings are no longer suppported, but they are real strings here
|
499 |
+
switch ( $data ) {
|
500 |
+
case '0'.'x0':
|
501 |
+
case '0': $result = __('No Flash', 'wp-photo-album-plus'); break;
|
502 |
+
case '0'.'x1':
|
503 |
+
case '1': $result = __('Fired', 'wp-photo-album-plus'); break;
|
504 |
+
case '0'.'x5':
|
505 |
+
case '5': $result = __('Fired, Return not detected', 'wp-photo-album-plus'); break;
|
506 |
+
case '0'.'x7':
|
507 |
+
case '7': $result = __('Fired, Return detected', 'wp-photo-album-plus'); break;
|
508 |
+
case '0'.'x8':
|
509 |
+
case '8': $result = __('On, Did not fire', 'wp-photo-album-plus'); break;
|
510 |
+
case '0'.'x9':
|
511 |
+
case '9': $result = __('On, Fired', 'wp-photo-album-plus'); break;
|
512 |
+
case '0'.'xd':
|
513 |
+
case '13': $result = __('On, Return not detected', 'wp-photo-album-plus'); break;
|
514 |
+
case '0'.'xf':
|
515 |
+
case '15': $result = __('On, Return detected', 'wp-photo-album-plus'); break;
|
516 |
+
case '0'.'x10':
|
517 |
+
case '16': $result = __('Off, Did not fire', 'wp-photo-album-plus'); break;
|
518 |
+
case '0'.'x14':
|
519 |
+
case '20': $result = __('Off, Did not fire, Return not detected', 'wp-photo-album-plus'); break;
|
520 |
+
case '0'.'x18':
|
521 |
+
case '24': $result = __('Auto, Did not fire', 'wp-photo-album-plus'); break;
|
522 |
+
case '0'.'x19':
|
523 |
+
case '25': $result = __('Auto, Fired', 'wp-photo-album-plus'); break;
|
524 |
+
case '0'.'x1d':
|
525 |
+
case '29': $result = __('Auto, Fired, Return not detected', 'wp-photo-album-plus'); break;
|
526 |
+
case '0'.'x1f':
|
527 |
+
case '31': $result = __('Auto, Fired, Return detected', 'wp-photo-album-plus'); break;
|
528 |
+
case '0'.'x20':
|
529 |
+
case '32': $result = __('No flash function', 'wp-photo-album-plus'); break;
|
530 |
+
case '0'.'x30':
|
531 |
+
case '48': $result = __('Off, No flash function', 'wp-photo-album-plus'); break;
|
532 |
+
case '0'.'x41':
|
533 |
+
case '65': $result = __('Fired, Red-eye reduction', 'wp-photo-album-plus'); break;
|
534 |
+
case '0'.'x45':
|
535 |
+
case '69': $result = __('Fired, Red-eye reduction, Return not detected', 'wp-photo-album-plus'); break;
|
536 |
+
case '0'.'x47':
|
537 |
+
case '71': $result = __('Fired, Red-eye reduction, Return detected', 'wp-photo-album-plus'); break;
|
538 |
+
case '0'.'x49':
|
539 |
+
case '73': $result = __('On, Red-eye reduction', 'wp-photo-album-plus'); break;
|
540 |
+
case '0'.'x4d':
|
541 |
+
case '77': $result = __('Red-eye reduction, Return not detected', 'wp-photo-album-plus'); break;
|
542 |
+
case '0'.'x4f':
|
543 |
+
case '79': $result = __('On, Red-eye reduction, Return detected', 'wp-photo-album-plus'); break;
|
544 |
+
case '0'.'x50':
|
545 |
+
case '80': $result = __('Off, Red-eye reduction', 'wp-photo-album-plus'); break;
|
546 |
+
case '0'.'x58':
|
547 |
+
case '88': $result = __('Auto, Did not fire, Red-eye reduction', 'wp-photo-album-plus'); break;
|
548 |
+
case '0'.'x59':
|
549 |
+
case '89': $result = __('Auto, Fired, Red-eye reduction', 'wp-photo-album-plus'); break;
|
550 |
+
case '0'.'x5d':
|
551 |
+
case '93': $result = __('Auto, Fired, Red-eye reduction, Return not detected', 'wp-photo-album-plus'); break;
|
552 |
+
case '0'.'x5f':
|
553 |
+
case '95': $result = __('Auto, Fired, Red-eye reduction, Return detected', 'wp-photo-album-plus'); break;
|
554 |
+
default:
|
555 |
+
$result = '<span title="' . esc_attr( __( 'Unknown', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
556 |
+
}
|
557 |
+
|
558 |
+
return $result;
|
559 |
+
break;
|
560 |
+
|
561 |
+
case 'E#A001': // ColorSpace
|
562 |
+
|
563 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
564 |
+
return $wppa_exif_error_output;
|
565 |
+
}
|
566 |
+
|
567 |
+
switch ( $data ) {
|
568 |
+
case 1:
|
569 |
+
$result = __( 'sRGB', 'wp-photo-album-plus' );
|
570 |
+
break;
|
571 |
+
case 0xFFFF:
|
572 |
+
$result = __( 'Uncalibrated', 'wp-photo-album-plus' );
|
573 |
+
break;
|
574 |
+
default:
|
575 |
+
$result = __( 'reserved', 'wp-photo-album-plus' );
|
576 |
+
}
|
577 |
+
|
578 |
+
return $result;
|
579 |
+
break;
|
580 |
+
|
581 |
+
case 'E#A402': // ExposureMode
|
582 |
+
|
583 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
584 |
+
return $wppa_exif_error_output;
|
585 |
+
}
|
586 |
+
|
587 |
+
switch ( $data ) {
|
588 |
+
case 0:
|
589 |
+
$result = __( 'Auto exposure', 'wp-photo-album-plus' );
|
590 |
+
break;
|
591 |
+
case 1:
|
592 |
+
$result = __( 'Manual exposure', 'wp-photo-album-plus' );
|
593 |
+
break;
|
594 |
+
case 2:
|
595 |
+
$result = __( 'Auto bracket', 'wp-photo-album-plus' );
|
596 |
+
break;
|
597 |
+
default:
|
598 |
+
$result = __( 'reserved', 'wp-photo-album-plus' );
|
599 |
+
}
|
600 |
+
|
601 |
+
return $result;
|
602 |
+
break;
|
603 |
+
|
604 |
+
|
605 |
+
// Unformatted
|
606 |
+
default:
|
607 |
+
$result = $data;
|
608 |
+
return $result;
|
609 |
+
}
|
610 |
+
}
|
611 |
+
|
612 |
+
// Empty data
|
613 |
+
else {
|
614 |
+
$result = '<span title="' . esc_attr( __( 'No data', 'wp-photo-album-plus' ) ) . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
615 |
}
|
616 |
|
617 |
return $result;
|
618 |
}
|
619 |
|
620 |
+
function wppa_is_valid_rational( $data, $signed = false ) {
|
621 |
+
global $wppa_exif_error_output;
|
622 |
+
|
623 |
+
// Must contain a '/'
|
624 |
+
if ( strpos( $data, '/' ) == false ) {
|
625 |
+
$wppa_exif_error_output = '<span title="' . esc_attr( __( 'Missing /', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
626 |
+
return false;
|
627 |
+
}
|
628 |
+
|
629 |
+
// make array
|
630 |
+
$t = explode( '/', $data );
|
631 |
+
|
632 |
+
// Divide by zero?
|
633 |
+
if ( $t[1] == 0 ) {
|
634 |
+
$wppa_exif_error_output = '<span title="' . esc_attr( __( 'Divide by zero', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
635 |
+
return false;
|
636 |
+
}
|
637 |
+
|
638 |
+
// Signed while not permitted?
|
639 |
+
if ( ! $signed && ( $t[0] < 0 || $t[1] < 0 ) ) {
|
640 |
+
$wppa_exif_error_output = '<span title="' . esc_attr( __( 'Must be positive', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
641 |
+
return false;
|
642 |
+
}
|
643 |
+
|
644 |
+
// Ok.
|
645 |
+
return true;
|
646 |
+
}
|
647 |
+
|
648 |
+
function wppa_is_valid_integer( $data, $signed = false ) {
|
649 |
+
global $wppa_exif_error_output;
|
650 |
+
|
651 |
+
// Must be integer
|
652 |
+
if ( ! wppa_is_int( $data ) ) {
|
653 |
+
$wppa_exif_error_output = '<span title="' . esc_attr( __( 'Invalid format', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
654 |
+
return false;
|
655 |
+
}
|
656 |
+
|
657 |
+
// Signed while not permitted?
|
658 |
+
if ( ! $signed && $data < 0 ) {
|
659 |
+
$wppa_exif_error_output = '<span title="' . esc_attr( __( 'Must be positive', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
660 |
+
return false;
|
661 |
+
}
|
662 |
+
|
663 |
+
// Ok.
|
664 |
+
return true;
|
665 |
+
}
|
666 |
+
|
667 |
function wppa_iptc_clean_garbage( $photo ) {
|
668 |
global $wpdb;
|
669 |
|
wppa-functions.php
CHANGED
@@ -3056,12 +3056,13 @@ function wppa_get_container_width( $netto = false ) {
|
|
3056 |
}
|
3057 |
if ( $netto ) {
|
3058 |
$result -= 12; // 2*padding
|
3059 |
-
$result -= 2 * wppa_opt( 'bwidth' );
|
3060 |
}
|
3061 |
return $result;
|
3062 |
}
|
3063 |
|
3064 |
function wppa_get_thumbnail_area_width() {
|
|
|
3065 |
$result = wppa_get_container_width();
|
3066 |
$result -= wppa_get_thumbnail_area_delta();
|
3067 |
return $result;
|
@@ -3069,8 +3070,7 @@ function wppa_get_thumbnail_area_width() {
|
|
3069 |
|
3070 |
function wppa_get_thumbnail_area_delta() {
|
3071 |
|
3072 |
-
|
3073 |
-
$result = 12 + 2 * wppa_opt( 'bwidth' ); // experimental
|
3074 |
return $result;
|
3075 |
}
|
3076 |
|
@@ -3415,7 +3415,7 @@ global $blog_id;
|
|
3415 |
if ( wppa_in_widget() ) $temp /= 2;
|
3416 |
wppa_add_js_page_data( "\n" . 'wppaFilmStripMargin['.wppa( 'mocc' ).'] = '.$temp.';' );
|
3417 |
$temp = 2*6 + 2*42 + ( wppa_opt( 'bwidth' ) ? 2*wppa_opt( 'bwidth' ) : 0 );
|
3418 |
-
if ( wppa_in_widget() ) $temp = 2*6 + 2*21 + 2*wppa_opt( 'bwidth' );
|
3419 |
wppa_add_js_page_data( "\n" . 'wppaFilmStripAreaDelta['.wppa( 'mocc' ).'] = '.$temp.';' );
|
3420 |
$temp = wppa_get_preambule();
|
3421 |
wppa_add_js_page_data( "\n" . 'wppaPreambule['.wppa( 'mocc' ).'] = '.$temp.';' );
|
@@ -3946,7 +3946,7 @@ function wppa_get_box_width() {
|
|
3946 |
|
3947 |
$result = wppa_get_container_width();
|
3948 |
$result -= 12; // 2 * padding
|
3949 |
-
$result -= 2 * wppa_opt( 'bwidth' );
|
3950 |
return $result;
|
3951 |
}
|
3952 |
|
@@ -4047,7 +4047,6 @@ function wppa_smx_photo( $stype ) {
|
|
4047 |
|
4048 |
// returns aspect ratio ( w/h ), or 1 on error
|
4049 |
function wppa_get_ratio( $id ) {
|
4050 |
-
global $wpdb;
|
4051 |
|
4052 |
if ( ! wppa_is_int( $id ) ) return '1'; // Not 0 to prevent divide by zero
|
4053 |
|
3056 |
}
|
3057 |
if ( $netto ) {
|
3058 |
$result -= 12; // 2*padding
|
3059 |
+
$result -= 2 * ( wppa_opt( 'bwidth' ) ? wppa_opt( 'bwidth' ) : '0' );
|
3060 |
}
|
3061 |
return $result;
|
3062 |
}
|
3063 |
|
3064 |
function wppa_get_thumbnail_area_width() {
|
3065 |
+
|
3066 |
$result = wppa_get_container_width();
|
3067 |
$result -= wppa_get_thumbnail_area_delta();
|
3068 |
return $result;
|
3070 |
|
3071 |
function wppa_get_thumbnail_area_delta() {
|
3072 |
|
3073 |
+
$result = 12 + 2 * ( wppa_opt( 'bwidth' ) ? wppa_opt( 'bwidth' ) : 0 );
|
|
|
3074 |
return $result;
|
3075 |
}
|
3076 |
|
3415 |
if ( wppa_in_widget() ) $temp /= 2;
|
3416 |
wppa_add_js_page_data( "\n" . 'wppaFilmStripMargin['.wppa( 'mocc' ).'] = '.$temp.';' );
|
3417 |
$temp = 2*6 + 2*42 + ( wppa_opt( 'bwidth' ) ? 2*wppa_opt( 'bwidth' ) : 0 );
|
3418 |
+
if ( wppa_in_widget() ) $temp = 2*6 + 2*21 + ( wppa_opt( 'bwidth' ) ? 2*wppa_opt( 'bwidth' ) : 0 );
|
3419 |
wppa_add_js_page_data( "\n" . 'wppaFilmStripAreaDelta['.wppa( 'mocc' ).'] = '.$temp.';' );
|
3420 |
$temp = wppa_get_preambule();
|
3421 |
wppa_add_js_page_data( "\n" . 'wppaPreambule['.wppa( 'mocc' ).'] = '.$temp.';' );
|
3946 |
|
3947 |
$result = wppa_get_container_width();
|
3948 |
$result -= 12; // 2 * padding
|
3949 |
+
$result -= 2 * ( wppa_opt( 'bwidth' ) ? wppa_opt( 'bwidth' ) : 0 );
|
3950 |
return $result;
|
3951 |
}
|
3952 |
|
4047 |
|
4048 |
// returns aspect ratio ( w/h ), or 1 on error
|
4049 |
function wppa_get_ratio( $id ) {
|
|
|
4050 |
|
4051 |
if ( ! wppa_is_int( $id ) ) return '1'; // Not 0 to prevent divide by zero
|
4052 |
|
wppa-picture.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Make the picture html
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -42,7 +42,7 @@ function wppa_get_picture_html( $args ) {
|
|
42 |
// Check existance of required args
|
43 |
foreach( array( 'id', 'type' ) as $item ) {
|
44 |
if ( ! $args[$item] ) {
|
45 |
-
|
46 |
return false;
|
47 |
}
|
48 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Make the picture html
|
6 |
+
* Version 6.7.12
|
7 |
*
|
8 |
*/
|
9 |
|
42 |
// Check existance of required args
|
43 |
foreach( array( 'id', 'type' ) as $item ) {
|
44 |
if ( ! $args[$item] ) {
|
45 |
+
wppa_dbg_msg( 'Missing ' . $item . ' in call to wppa_get_picture_html()', 'red' );
|
46 |
return false;
|
47 |
}
|
48 |
}
|
wppa-settings-autosave.php
CHANGED
@@ -26,7 +26,11 @@ global $wppa_tags;
|
|
26 |
global $wp_version;
|
27 |
|
28 |
// Start test area
|
29 |
-
|
|
|
|
|
|
|
|
|
30 |
// End test area
|
31 |
|
32 |
// Initialize
|
26 |
global $wp_version;
|
27 |
|
28 |
// Start test area
|
29 |
+
//$data = $wpdb->get_col("SELECT DISTINCT `description` FROM `".WPPA_EXIF."` WHERE `tag` = 'E#9206' ORDER BY `description`");
|
30 |
+
//echo count( $data ).'<br />';
|
31 |
+
//foreach( $data as $item ) {
|
32 |
+
// echo $item . ' -> ' . wppa_format_exif( 'E#9206', $item ) . '<br />';
|
33 |
+
//}
|
34 |
// End test area
|
35 |
|
36 |
// Initialize
|
wppa-tinymce-photo-front.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-tinymce-photo-front.php
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
-
* Version 6.7.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -52,9 +52,6 @@ global $wpdb;
|
|
52 |
// Find an existing photo
|
53 |
$id = $wpdb->get_var( "SELECT `id` FROM " . WPPA_PHOTOS . " WHERE `ext` <> 'xxx' ORDER BY `timestamp` DESC LIMIT 1" );
|
54 |
|
55 |
-
// do_shortcode( '[photo ' . $id . ']' ) increments occur, save value for later
|
56 |
-
$o = wppa( 'occur' );
|
57 |
-
|
58 |
// Things that wppa-tinymce.js AND OTHER MODULES!!! need to know
|
59 |
echo
|
60 |
'<script type="text/javascript">
|
@@ -67,15 +64,13 @@ global $wpdb;
|
|
67 |
wppaTxtDone = "' . __( 'Done!', 'wp-photo-album-plus' ) . '";
|
68 |
wppaTxtErrUnable = "' . __( 'ERROR: unable to upload files.', 'wp-photo-album-plus' ) . '";
|
69 |
wppaOutputType = "' . wppa_opt( 'photo_shortcode_fe_type' ) . '";
|
70 |
-
wppaShortcodeTemplate = "' . esc_js(
|
71 |
wppaShortcodeTemplateId = "' . $id . '.' . wppa_get_photo_item( $id, 'ext' ) . '";
|
72 |
/* ]]> */
|
73 |
</script>';
|
74 |
|
75 |
$done = true;
|
76 |
-
|
77 |
-
// Reset occur
|
78 |
-
wppa( 'occur', $o );
|
79 |
}
|
80 |
}
|
81 |
|
2 |
/* wppa-tinymce-photo-front.php
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
+
* Version 6.7.12
|
6 |
*
|
7 |
*/
|
8 |
|
52 |
// Find an existing photo
|
53 |
$id = $wpdb->get_var( "SELECT `id` FROM " . WPPA_PHOTOS . " WHERE `ext` <> 'xxx' ORDER BY `timestamp` DESC LIMIT 1" );
|
54 |
|
|
|
|
|
|
|
55 |
// Things that wppa-tinymce.js AND OTHER MODULES!!! need to know
|
56 |
echo
|
57 |
'<script type="text/javascript">
|
64 |
wppaTxtDone = "' . __( 'Done!', 'wp-photo-album-plus' ) . '";
|
65 |
wppaTxtErrUnable = "' . __( 'ERROR: unable to upload files.', 'wp-photo-album-plus' ) . '";
|
66 |
wppaOutputType = "' . wppa_opt( 'photo_shortcode_fe_type' ) . '";
|
67 |
+
wppaShortcodeTemplate = "' . esc_js( wppa_get_picture_html( array( 'id' => $id, 'type' => 'sphoto' ) ) ) . '";
|
68 |
wppaShortcodeTemplateId = "' . $id . '.' . wppa_get_photo_item( $id, 'ext' ) . '";
|
69 |
/* ]]> */
|
70 |
</script>';
|
71 |
|
72 |
$done = true;
|
73 |
+
|
|
|
|
|
74 |
}
|
75 |
}
|
76 |
|
wppa.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
-
* Version: 6.7.
|
6 |
* Author: J.N. Breetvelt a.k.a. OpaJaap
|
7 |
* Author URI: http://wppa.opajaap.nl/
|
8 |
* Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
|
@@ -22,8 +22,8 @@ global $wpdb;
|
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
-
global $wppa_revno; $wppa_revno = '
|
26 |
-
global $wppa_api_version; $wppa_api_version = '6-7-
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
+
* Version: 6.7.12
|
6 |
* Author: J.N. Breetvelt a.k.a. OpaJaap
|
7 |
* Author URI: http://wppa.opajaap.nl/
|
8 |
* Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
+
global $wppa_revno; $wppa_revno = '6712'; // WPPA db version
|
26 |
+
global $wppa_api_version; $wppa_api_version = '6-7-012-008'; // WPPA software version
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|