Version Description
= 7.5.10 =
- This version addresses various bug fixes and feature requests.
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 7.5.10.004 |
Comparing to | |
See all releases |
Code changes from version 7.5.10.002 to 7.5.10.004
- changelog.txt +2 -0
- readme.txt +1 -1
- wppa-admin.php +3 -3
- wppa-ajax.php +2 -2
- wppa-boxes-html.php +1 -1
- wppa-local-cdn.php +14 -6
- wppa-photo-admin-autosave.php +1 -1
- wppa-photo-files.php +43 -13
- wppa-settings-autosave.php +68 -3
- wppa-utils.php +7 -2
- wppa.php +2 -2
changelog.txt
CHANGED
@@ -5,6 +5,8 @@ WP Photo Album Plus Changelog
|
|
5 |
* Searching on numbers on the album admin screen now also returns real search results besides the already implemented list of ids.
|
6 |
* Slideshow filmstrips now aways use the thumbnail files, regardless of selected aspect ratio or cdn service.
|
7 |
* Extended options for slidehow animation time in Table IV-B6.
|
|
|
|
|
8 |
|
9 |
= 7.5.09 =
|
10 |
|
5 |
* Searching on numbers on the album admin screen now also returns real search results besides the already implemented list of ids.
|
6 |
* Slideshow filmstrips now aways use the thumbnail files, regardless of selected aspect ratio or cdn service.
|
7 |
* Extended options for slidehow animation time in Table IV-B6.
|
8 |
+
* Fixed a imagick command that could cause unwanted padding in thumbnail creation.
|
9 |
+
* The availebility of ImagMagick is now detected and activated automatically on opening the settings page the first time after install/update if it was not already done manually.
|
10 |
|
11 |
= 7.5.09 =
|
12 |
|
readme.txt
CHANGED
@@ -134,7 +134,7 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
|
|
134 |
|
135 |
== Upgrade Notice ==
|
136 |
|
137 |
-
= 7.5.
|
138 |
|
139 |
* This version addresses various bug fixes and feature requests.
|
140 |
|
134 |
|
135 |
== Upgrade Notice ==
|
136 |
|
137 |
+
= 7.5.10 =
|
138 |
|
139 |
* This version addresses various bug fixes and feature requests.
|
140 |
|
wppa-admin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains the admin menu and startups the admin pages
|
6 |
-
* Version 7.5.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -83,7 +83,7 @@ global $wppa_api_version;
|
|
83 |
wp_register_style( 'wppa_admin_style', WPPA_URL.'/wppa-admin-styles.css', '', $wppa_api_version );
|
84 |
wp_enqueue_style( 'wppa_admin_style' );
|
85 |
|
86 |
-
if (
|
87 |
wp_register_style( 'wppa_cropper_style', WPPA_URL.'/vendor/cropperjs/dist/cropper.min.css' );
|
88 |
wp_enqueue_style( 'wppa_cropper_style' );
|
89 |
}
|
@@ -117,7 +117,7 @@ global $wppa_api_version;
|
|
117 |
wp_enqueue_script( 'wppa', WPPA_URL . '/js/wppa.js', array(), $wppa_api_version );
|
118 |
wp_enqueue_script( 'wppa-slideshow', WPPA_URL . '/js/wppa-slideshow.js', array(), $wppa_api_version );
|
119 |
wp_enqueue_script( 'wppa-ajax-front', WPPA_URL . '/js/wppa-ajax-front.js', array(), $wppa_api_version );
|
120 |
-
if (
|
121 |
wp_enqueue_script( 'cropperjs', WPPA_URL . '/vendor/cropperjs/dist/cropper.min.js', array(), $wppa_api_version );
|
122 |
}
|
123 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains the admin menu and startups the admin pages
|
6 |
+
* Version 7.5.10
|
7 |
*
|
8 |
*/
|
9 |
|
83 |
wp_register_style( 'wppa_admin_style', WPPA_URL.'/wppa-admin-styles.css', '', $wppa_api_version );
|
84 |
wp_enqueue_style( 'wppa_admin_style' );
|
85 |
|
86 |
+
if ( wppa_can_magick() ) {
|
87 |
wp_register_style( 'wppa_cropper_style', WPPA_URL.'/vendor/cropperjs/dist/cropper.min.css' );
|
88 |
wp_enqueue_style( 'wppa_cropper_style' );
|
89 |
}
|
117 |
wp_enqueue_script( 'wppa', WPPA_URL . '/js/wppa.js', array(), $wppa_api_version );
|
118 |
wp_enqueue_script( 'wppa-slideshow', WPPA_URL . '/js/wppa-slideshow.js', array(), $wppa_api_version );
|
119 |
wp_enqueue_script( 'wppa-ajax-front', WPPA_URL . '/js/wppa-ajax-front.js', array(), $wppa_api_version );
|
120 |
+
if ( wppa_can_magick() ) {
|
121 |
wp_enqueue_script( 'cropperjs', WPPA_URL . '/vendor/cropperjs/dist/cropper.min.js', array(), $wppa_api_version );
|
122 |
}
|
123 |
}
|
wppa-ajax.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
-
* Version 7.5.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -3740,7 +3740,7 @@ global $wppa_opt;
|
|
3740 |
break;
|
3741 |
case 'wppa_image_magick':
|
3742 |
$value = rtrim( $value, '/' );
|
3743 |
-
if ( $value ) {
|
3744 |
$out = array();
|
3745 |
exec( escapeshellcmd( $value . '/convert' ), $out, $err );
|
3746 |
$ok = ( count( $out ) != 0 );
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
+
* Version 7.5.10
|
6 |
*
|
7 |
*/
|
8 |
|
3740 |
break;
|
3741 |
case 'wppa_image_magick':
|
3742 |
$value = rtrim( $value, '/' );
|
3743 |
+
if ( $value && $value != 'none' ) {
|
3744 |
$out = array();
|
3745 |
exec( escapeshellcmd( $value . '/convert' ), $out, $err );
|
3746 |
$ok = ( count( $out ) != 0 );
|
wppa-boxes-html.php
CHANGED
@@ -2936,7 +2936,7 @@ static $albums_granted;
|
|
2936 |
if ( $may_audio ) {
|
2937 |
$body .= ', ' . implode( ', .', $wppa_supported_audio_extensions );
|
2938 |
}
|
2939 |
-
if ( wppa_switch( 'enable_pdf' ) &&
|
2940 |
$body .= ', .pdf';
|
2941 |
}
|
2942 |
$body .=
|
2936 |
if ( $may_audio ) {
|
2937 |
$body .= ', ' . implode( ', .', $wppa_supported_audio_extensions );
|
2938 |
}
|
2939 |
+
if ( wppa_switch( 'enable_pdf' ) && wppa_can_magick() ) {
|
2940 |
$body .= ', .pdf';
|
2941 |
}
|
2942 |
$body .=
|
wppa-local-cdn.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains routines for local cdn implementation
|
6 |
-
* Version 7.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -64,7 +64,7 @@ function wppa_cdn_make( $id, $x, $y ) {
|
|
64 |
|
65 |
// Create scaled image
|
66 |
// ImageMagick
|
67 |
-
if (
|
68 |
|
69 |
// If jpg, apply jpeg quality
|
70 |
$q = wppa_opt( 'jpeg_quality' );
|
@@ -73,10 +73,18 @@ function wppa_cdn_make( $id, $x, $y ) {
|
|
73 |
$quality = '-quality ' . $q;
|
74 |
}
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
// Log what we did
|
82 |
if ( $err ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains routines for local cdn implementation
|
6 |
+
* Version 7.5.10
|
7 |
*
|
8 |
*/
|
9 |
|
64 |
|
65 |
// Create scaled image
|
66 |
// ImageMagick
|
67 |
+
if ( wppa_can_magick() ) {
|
68 |
|
69 |
// If jpg, apply jpeg quality
|
70 |
$q = wppa_opt( 'jpeg_quality' );
|
73 |
$quality = '-quality ' . $q;
|
74 |
}
|
75 |
|
76 |
+
// Internal?
|
77 |
+
if ( class_exists( 'Imagick' ) ) {
|
78 |
+
$im = new Imagick( $fmpath );
|
79 |
+
$im->resizeImage( $x, $y, Imagick::FILTER_CATROM, 1 );
|
80 |
+
$bret = $im->writeImage( $topath );
|
81 |
+
$im->destroy();
|
82 |
+
$err = ! $bret;
|
83 |
+
}
|
84 |
+
else {
|
85 |
+
$err = wppa_image_magick( 'convert ' . $fmpath . ' ' . $quality . ' -resize ' . $x . 'x' . $y . ' ' . $topath );
|
86 |
+
wppa_optimize_image_file( $topath );
|
87 |
+
}
|
88 |
|
89 |
// Log what we did
|
90 |
if ( $err ) {
|
wppa-photo-admin-autosave.php
CHANGED
@@ -3708,7 +3708,7 @@ function wppa_fe_edit_new_style( $photo ) {
|
|
3708 |
function wppa_can_admin_magick( $id ) {
|
3709 |
|
3710 |
// Is ImageMagick on board?
|
3711 |
-
if ( !
|
3712 |
return false;
|
3713 |
}
|
3714 |
|
3708 |
function wppa_can_admin_magick( $id ) {
|
3709 |
|
3710 |
// Is ImageMagick on board?
|
3711 |
+
if ( ! wppa_can_magick() ) {
|
3712 |
return false;
|
3713 |
}
|
3714 |
|
wppa-photo-files.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-photo-files.php
|
3 |
*
|
4 |
* Functions used to create/manipulate photofiles
|
5 |
-
* Version 7.5.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -35,7 +35,7 @@ function wppa_make_o1_source( $id ) {
|
|
35 |
$dst_path = wppa_get_o1_source_path( $id );
|
36 |
|
37 |
// ImageMagick
|
38 |
-
if (
|
39 |
wppa_image_magick( 'convert ' . $src_path . ' -auto-orient ' . $dst_path );
|
40 |
}
|
41 |
|
@@ -197,7 +197,7 @@ wppa_log('dbg', 'make called with'.$file.' '.$id.' '.$ext.' '.$do_thumb. ' exist
|
|
197 |
if ( wppa_switch( 'resize_on_upload' ) && wppa_can_resize( $file, max( $max_width, $max_height ) ) ) {
|
198 |
|
199 |
// ImageMagick
|
200 |
-
if (
|
201 |
|
202 |
// If jpg, apply jpeg quality
|
203 |
$q = wppa_opt( 'jpeg_quality' );
|
@@ -213,7 +213,7 @@ wppa_log('dbg', 'make called with'.$file.' '.$id.' '.$ext.' '.$do_thumb. ' exist
|
|
213 |
}
|
214 |
|
215 |
// Classic GD
|
216 |
-
if ( !
|
217 |
|
218 |
// Picture sizes
|
219 |
$src_width = $src_size[0];
|
@@ -507,19 +507,46 @@ function wppa_create_thumbnail( $id, $use_source = true ) {
|
|
507 |
$src_size_w *= 2;
|
508 |
}
|
509 |
|
|
|
|
|
510 |
// Enough memory?
|
511 |
if ( wppa_can_resize( $file, $max_side ) ) {
|
512 |
|
513 |
-
|
514 |
-
|
515 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
516 |
if ( $iret ) {
|
517 |
-
wppa_log( 'fso', 'Magick could not create ' . $thumbpath );
|
|
|
|
|
|
|
|
|
518 |
}
|
519 |
}
|
520 |
|
521 |
// Classic GD
|
522 |
-
|
|
|
523 |
// Create the source image
|
524 |
switch ( $mime ) { // mime type
|
525 |
case 1: // gif
|
@@ -543,7 +570,7 @@ function wppa_create_thumbnail( $id, $use_source = true ) {
|
|
543 |
break;
|
544 |
}
|
545 |
if ( ! $src ) {
|
546 |
-
wppa_log( 'Error', 'Image file '
|
547 |
return true;
|
548 |
}
|
549 |
|
@@ -667,6 +694,9 @@ function wppa_create_thumbnail( $id, $use_source = true ) {
|
|
667 |
}
|
668 |
$thumbpath = $full_thumbpath;
|
669 |
|
|
|
|
|
|
|
670 |
// Cleanup
|
671 |
imagedestroy( $src );
|
672 |
imagedestroy( $dst );
|
@@ -674,7 +704,7 @@ function wppa_create_thumbnail( $id, $use_source = true ) {
|
|
674 |
}
|
675 |
|
676 |
// Too litlle memory
|
677 |
-
|
678 |
wppa_copy( $file, $thumbpath );
|
679 |
}
|
680 |
|
@@ -694,7 +724,7 @@ function wppa_is_magick( $command ) {
|
|
694 |
if ( ! $command ) {
|
695 |
return false;
|
696 |
}
|
697 |
-
if ( !
|
698 |
return false;
|
699 |
}
|
700 |
return is_file( rtrim( wppa_opt( 'image_magick' ), '/' ) . '/' . $command );
|
@@ -704,7 +734,7 @@ function wppa_is_magick( $command ) {
|
|
704 |
function wppa_image_magick( $command ) {
|
705 |
|
706 |
// Image magic enabled?
|
707 |
-
if ( !
|
708 |
return '-9';
|
709 |
}
|
710 |
|
2 |
/* wppa-photo-files.php
|
3 |
*
|
4 |
* Functions used to create/manipulate photofiles
|
5 |
+
* Version 7.5.10
|
6 |
*
|
7 |
*/
|
8 |
|
35 |
$dst_path = wppa_get_o1_source_path( $id );
|
36 |
|
37 |
// ImageMagick
|
38 |
+
if ( wppa_can_magick() ) {
|
39 |
wppa_image_magick( 'convert ' . $src_path . ' -auto-orient ' . $dst_path );
|
40 |
}
|
41 |
|
197 |
if ( wppa_switch( 'resize_on_upload' ) && wppa_can_resize( $file, max( $max_width, $max_height ) ) ) {
|
198 |
|
199 |
// ImageMagick
|
200 |
+
if ( wppa_can_magick() ) {
|
201 |
|
202 |
// If jpg, apply jpeg quality
|
203 |
$q = wppa_opt( 'jpeg_quality' );
|
213 |
}
|
214 |
|
215 |
// Classic GD
|
216 |
+
if ( ! wppa_can_magick() || ! is_file( $newimage ) ) {
|
217 |
|
218 |
// Picture sizes
|
219 |
$src_width = $src_size[0];
|
507 |
$src_size_w *= 2;
|
508 |
}
|
509 |
|
510 |
+
$done = false;
|
511 |
+
|
512 |
// Enough memory?
|
513 |
if ( wppa_can_resize( $file, $max_side ) ) {
|
514 |
|
515 |
+
$frac = $max_side / max( $img_attr[0],$img_attr[1] );
|
516 |
+
$perc = 100 * $frac;
|
517 |
+
|
518 |
+
// Image Magick class?
|
519 |
+
if ( class_exists( 'Imagick' ) && wppa_can_magick() && $type == 'none' ) {
|
520 |
+
$im = new Imagick( $file );
|
521 |
+
$im->thumbnailImage( $frac * $img_attr[0], $frac * $img_attr[1] );
|
522 |
+
$iret = $im->writeImage( $thumbpath );
|
523 |
+
$im->destroy();
|
524 |
+
if ( $iret ) {
|
525 |
+
wppa_log( 'fso', 'Magick class created ' . $thumbpath );
|
526 |
+
$done = true;
|
527 |
+
}
|
528 |
+
else {
|
529 |
+
wppa_log( 'fso', 'Magick class could not create ' . $thumbpath );
|
530 |
+
}
|
531 |
+
}
|
532 |
+
// External Magick command?
|
533 |
+
elseif ( wppa_can_magick() && $type == 'none' ) {
|
534 |
+
|
535 |
+
$cmd = 'convert ' . $file . ' -thumbnail ' . $perc . '% ' . $thumbpath;
|
536 |
+
wppa_log( 'fso', 'Magick command = ' . $cmd );
|
537 |
+
$iret = wppa_image_magick( $cmd );
|
538 |
if ( $iret ) {
|
539 |
+
wppa_log( 'fso', 'Magick command could not create ' . $thumbpath );
|
540 |
+
}
|
541 |
+
else {
|
542 |
+
wppa_log( 'fso', 'Magick command created ' . $thumbpath );
|
543 |
+
$done = true;
|
544 |
}
|
545 |
}
|
546 |
|
547 |
// Classic GD
|
548 |
+
if ( ! $done ) {
|
549 |
+
|
550 |
// Create the source image
|
551 |
switch ( $mime ) { // mime type
|
552 |
case 1: // gif
|
570 |
break;
|
571 |
}
|
572 |
if ( ! $src ) {
|
573 |
+
wppa_log( 'Error', 'Image file ' . $file . ' is corrupt while creating thmbnail' );
|
574 |
return true;
|
575 |
}
|
576 |
|
694 |
}
|
695 |
$thumbpath = $full_thumbpath;
|
696 |
|
697 |
+
wppa_log( 'fso', 'GD created ' . $thumbpath );
|
698 |
+
$done = true;
|
699 |
+
|
700 |
// Cleanup
|
701 |
imagedestroy( $src );
|
702 |
imagedestroy( $dst );
|
704 |
}
|
705 |
|
706 |
// Too litlle memory
|
707 |
+
if ( ! $done ) {
|
708 |
wppa_copy( $file, $thumbpath );
|
709 |
}
|
710 |
|
724 |
if ( ! $command ) {
|
725 |
return false;
|
726 |
}
|
727 |
+
if ( ! wppa_can_magick() ) {
|
728 |
return false;
|
729 |
}
|
730 |
return is_file( rtrim( wppa_opt( 'image_magick' ), '/' ) . '/' . $command );
|
734 |
function wppa_image_magick( $command ) {
|
735 |
|
736 |
// Image magic enabled?
|
737 |
+
if ( ! wppa_can_magick() ) {
|
738 |
return '-9';
|
739 |
}
|
740 |
|
wppa-settings-autosave.php
CHANGED
@@ -37,9 +37,6 @@ global $wppa_supported_camara_brands;
|
|
37 |
// Re-animate crashec cron jobs
|
38 |
wppa_re_animate_cron();
|
39 |
|
40 |
-
// Make sure translatable defaults are translated
|
41 |
-
// wppa_set_defaults();
|
42 |
-
|
43 |
// If watermark all is going to be run, make sure the current user has no private overrule settings
|
44 |
delete_option( 'wppa_watermark_file_'.wppa_get_user() );
|
45 |
delete_option( 'wppa_watermark_pos_'.wppa_get_user() );
|
@@ -452,6 +449,39 @@ global $wppa_supported_camara_brands;
|
|
452 |
wppa_warning_message( $stdmsg . $msg );
|
453 |
}
|
454 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
455 |
?>
|
456 |
<!--<br /><a href="javascript:window.print();"><?php //_e('Print settings') ?></a><br />-->
|
457 |
<a style="cursor:pointer;" id="wppa-legon" onclick="jQuery('#wppa-legenda').css('display', ''); jQuery('#wppa-legon').css('display', 'none'); return false;" ><?php _e('Show legenda', 'wp-photo-album-plus') ?></a>
|
@@ -12782,3 +12812,38 @@ global $wppa_opt;
|
|
12782 |
}
|
12783 |
}
|
12784 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
// Re-animate crashec cron jobs
|
38 |
wppa_re_animate_cron();
|
39 |
|
|
|
|
|
|
|
40 |
// If watermark all is going to be run, make sure the current user has no private overrule settings
|
41 |
delete_option( 'wppa_watermark_file_'.wppa_get_user() );
|
42 |
delete_option( 'wppa_watermark_pos_'.wppa_get_user() );
|
449 |
wppa_warning_message( $stdmsg . $msg );
|
450 |
}
|
451 |
}
|
452 |
+
|
453 |
+
// Check for ImageMagick
|
454 |
+
if ( ! wppa_opt( 'image_magick' ) ) {
|
455 |
+
if ( class_exists( 'Imagick' ) ) {
|
456 |
+
|
457 |
+
$result = wppa_search_magick();
|
458 |
+
$mes = __('Image Magick is detected on your server', 'wp-photo-album-plus') . '. ';
|
459 |
+
$mes .= __('To be able to use the most advanted features of WPPA, the Imagic shellcommand <b>convert</b> must be available', 'wp-photo-album-plus') . '.<br />';
|
460 |
+
|
461 |
+
// Shell command found
|
462 |
+
if ( ! empty( $result ) ) {
|
463 |
+
$mes .= __('This command is found on the following file system locations', 'wp-photo-album-plus') . ':<br />';
|
464 |
+
foreach ( $result as $item ) {
|
465 |
+
$mes .= $item[0] . '<br />';
|
466 |
+
}
|
467 |
+
update_option( 'wppa_image_magick', $result[0][0] );
|
468 |
+
$wppa_opt['wppa_image_magick'] = $result[0][0];
|
469 |
+
$mes .= sprintf( __('The location <b>%s</b> has been entered in <b>Table IX-K7</b>', 'wp-photo-album-plus'), $result[0][0] ) . '.<br />';
|
470 |
+
$mes .= __('You may change it into a different path that contains the Imagick <b>convert</b> command at any time', 'wp-photo-album-plus') . '.<br />';
|
471 |
+
}
|
472 |
+
|
473 |
+
// Shell command not found
|
474 |
+
else {
|
475 |
+
$mes .= __('The Imagick shellcommand <b>convert</b> could not be detected.', 'wp-photo-album-plus') . '<br >';
|
476 |
+
$mes .= __('Ask your hosting provider for the absolute path to this command if it is available', 'wp-photo-album-plus') . '<br />';
|
477 |
+
}
|
478 |
+
|
479 |
+
$mes .= __('If you do not want to use Imagick, enter <b>none</b> in <b>Table IX-K7</b>', 'wp-photo-album-plus' ) . '<br />';
|
480 |
+
$mes .= __('If you want to see this message again, clear <b>Table IX-K7</b> and reload this page', 'wp-photo-album-plus');
|
481 |
+
|
482 |
+
wppa_ok_message($mes);
|
483 |
+
}
|
484 |
+
}
|
485 |
?>
|
486 |
<!--<br /><a href="javascript:window.print();"><?php //_e('Print settings') ?></a><br />-->
|
487 |
<a style="cursor:pointer;" id="wppa-legon" onclick="jQuery('#wppa-legenda').css('display', ''); jQuery('#wppa-legon').css('display', 'none'); return false;" ><?php _e('Show legenda', 'wp-photo-album-plus') ?></a>
|
12812 |
}
|
12813 |
}
|
12814 |
|
12815 |
+
function wppa_search_magick( $root = '' ) {
|
12816 |
+
static $level;
|
12817 |
+
if ( ! $level ) $level = 1;
|
12818 |
+
|
12819 |
+
static $result;
|
12820 |
+
if ( ! $result ) $result = array();
|
12821 |
+
|
12822 |
+
$paths = glob( $root . '/*', GLOB_ONLYDIR );
|
12823 |
+
foreach( $paths as $path ) if ( $path != '..' && $path != '.' ) {
|
12824 |
+
|
12825 |
+
$file = basename( $path );
|
12826 |
+
if ( ! in_array( $file, array( 'wp-admin', 'wp-content', 'wp-include' ) ) ) {
|
12827 |
+
|
12828 |
+
if ( is_readable( $path ) ) {
|
12829 |
+
|
12830 |
+
if ( is_file( $path . '/convert' ) ) {
|
12831 |
+
exec( escapeshellcmd( $path . '/convert -version' ), $out, $err );
|
12832 |
+
if ( ! $err ) {
|
12833 |
+
$ver = strpos( $out[0], 'ImageMagick' );
|
12834 |
+
if ( $ver != false ) {
|
12835 |
+
$result[] = array( $path, $out[0] );
|
12836 |
+
}
|
12837 |
+
}
|
12838 |
+
unset( $out );
|
12839 |
+
}
|
12840 |
+
elseif ( $level < 4 ) {
|
12841 |
+
$level++;
|
12842 |
+
wppa_search_magick( $path );
|
12843 |
+
$level--;
|
12844 |
+
}
|
12845 |
+
}
|
12846 |
+
}
|
12847 |
+
}
|
12848 |
+
return $result;
|
12849 |
+
}
|
wppa-utils.php
CHANGED
@@ -4734,7 +4734,7 @@ function wppa_pdf_preprocess( &$file, $alb ) {
|
|
4734 |
// Make it a jpg in the source dir,
|
4735 |
$pdf = $file['name'];
|
4736 |
$jpg = wppa_strip_ext( $pdf ) . '.jpg';
|
4737 |
-
$err = wppa_image_magick( 'convert -
|
4738 |
|
4739 |
// Log what we did
|
4740 |
if ( $err ) {
|
@@ -4746,7 +4746,7 @@ function wppa_pdf_preprocess( &$file, $alb ) {
|
|
4746 |
|
4747 |
// Report imagemagick coud not create posterfile
|
4748 |
if ( $err ) {
|
4749 |
-
if (
|
4750 |
$png = wppa_strip_ext( $jpg ) . '.png';
|
4751 |
if ( wppa( 'ajax' ) ) {
|
4752 |
wppa( 'ajax_import_files_error', __( 'Could not create %s, you may upload a self created imagefile with this name or %s', 'wp-photo-album-plus' ), $jpg, $png );
|
@@ -5112,3 +5112,8 @@ function _wppa_get_nesting_level( $id ) {
|
|
5112 |
return '0';
|
5113 |
}
|
5114 |
}
|
|
|
|
|
|
|
|
|
|
4734 |
// Make it a jpg in the source dir,
|
4735 |
$pdf = $file['name'];
|
4736 |
$jpg = wppa_strip_ext( $pdf ) . '.jpg';
|
4737 |
+
$err = wppa_image_magick( 'convert -density 150 ' . $src . '/' . $pdf . '[0] -quality 90 -background white -alpha remove ' . $src . '/' . $jpg );
|
4738 |
|
4739 |
// Log what we did
|
4740 |
if ( $err ) {
|
4746 |
|
4747 |
// Report imagemagick coud not create posterfile
|
4748 |
if ( $err ) {
|
4749 |
+
if ( wppa_can_magick() ) {
|
4750 |
$png = wppa_strip_ext( $jpg ) . '.png';
|
4751 |
if ( wppa( 'ajax' ) ) {
|
4752 |
wppa( 'ajax_import_files_error', __( 'Could not create %s, you may upload a self created imagefile with this name or %s', 'wp-photo-album-plus' ), $jpg, $png );
|
5112 |
return '0';
|
5113 |
}
|
5114 |
}
|
5115 |
+
|
5116 |
+
// Can we do magick?
|
5117 |
+
function wppa_can_magick() {
|
5118 |
+
return ( wppa_opt( 'image_magick' ) && wppa_opt( 'image_magick' ) != 'none' );
|
5119 |
+
}
|
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: 7.5.10.
|
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/
|
@@ -24,7 +24,7 @@ global $wp_version;
|
|
24 |
|
25 |
/* WPPA GLOBALS */
|
26 |
global $wppa_revno; $wppa_revno = '7510'; // WPPA db version
|
27 |
-
global $wppa_api_version; $wppa_api_version = '7.5.10.
|
28 |
|
29 |
/* Init page js data */
|
30 |
global $wppa_js_page_data; $wppa_js_page_data = '';
|
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: 7.5.10.004
|
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/
|
24 |
|
25 |
/* WPPA GLOBALS */
|
26 |
global $wppa_revno; $wppa_revno = '7510'; // WPPA db version
|
27 |
+
global $wppa_api_version; $wppa_api_version = '7.5.10.004'; // WPPA software version
|
28 |
|
29 |
/* Init page js data */
|
30 |
global $wppa_js_page_data; $wppa_js_page_data = '';
|