Changeset 1677886
- Timestamp:
- 06/13/2017 08:10:47 PM (9 years ago)
- Location:
- gs-only-pdf-preview
- Files:
-
- 9 edited
- 10 copied
-
tags/1.0.7 (copied) (copied from gs-only-pdf-preview/trunk)
-
tags/1.0.7/gs-only-pdf-preview.php (copied) (copied from gs-only-pdf-preview/trunk/gs-only-pdf-preview.php) (3 diffs)
-
tags/1.0.7/includes/class-gopp-image-editor-gs.php (copied) (copied from gs-only-pdf-preview/trunk/includes/class-gopp-image-editor-gs.php) (4 diffs)
-
tags/1.0.7/includes/debug-gopp-image-editor-gs.php (copied) (copied from gs-only-pdf-preview/trunk/includes/debug-gopp-image-editor-gs.php) (2 diffs)
-
tags/1.0.7/js/gs-only-pdf-preview.js (copied) (copied from gs-only-pdf-preview/trunk/js/gs-only-pdf-preview.js) (1 diff)
-
tags/1.0.7/js/gs-only-pdf-preview.min.js (copied) (copied from gs-only-pdf-preview/trunk/js/gs-only-pdf-preview.min.js) (1 diff)
-
tags/1.0.7/languages/gs-only-pdf-preview-fr_FR.mo (copied) (copied from gs-only-pdf-preview/trunk/languages/gs-only-pdf-preview-fr_FR.mo)
-
tags/1.0.7/languages/gs-only-pdf-preview-fr_FR.po (copied) (copied from gs-only-pdf-preview/trunk/languages/gs-only-pdf-preview-fr_FR.po) (16 diffs)
-
tags/1.0.7/languages/gs-only-pdf-preview.pot (copied) (copied from gs-only-pdf-preview/trunk/languages/gs-only-pdf-preview.pot) (7 diffs)
-
tags/1.0.7/readme.txt (copied) (copied from gs-only-pdf-preview/trunk/readme.txt) (10 diffs)
-
trunk/gs-only-pdf-preview.php (modified) (3 diffs)
-
trunk/includes/class-gopp-image-editor-gs.php (modified) (4 diffs)
-
trunk/includes/debug-gopp-image-editor-gs.php (modified) (2 diffs)
-
trunk/js/gs-only-pdf-preview.js (modified) (1 diff)
-
trunk/js/gs-only-pdf-preview.min.js (modified) (1 diff)
-
trunk/languages/gs-only-pdf-preview-fr_FR.mo (modified) (previous)
-
trunk/languages/gs-only-pdf-preview-fr_FR.po (modified) (16 diffs)
-
trunk/languages/gs-only-pdf-preview.pot (modified) (7 diffs)
-
trunk/readme.txt (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gs-only-pdf-preview/tags/1.0.7/gs-only-pdf-preview.php
r1638573 r1677886 4 4 * Plugin URI: https://github.com/gitlost/gs-only-pdf-preview 5 5 * Description: Uses Ghostscript directly to generate PDF previews. 6 * Version: 1.0. 66 * Version: 1.0.7 7 7 * Author: gitlost 8 8 * Author URI: https://profiles.wordpress.org/gitlost … … 17 17 18 18 // These need to be synced with "readme.txt". 19 define( 'GOPP_PLUGIN_VERSION', '1.0. 6' ); // Sync also "package.json" and "language/gs-only-pdf-preview.pot".19 define( 'GOPP_PLUGIN_VERSION', '1.0.7' ); // Sync also "package.json" and "language/gs-only-pdf-preview.pot". 20 20 define( 'GOPP_PLUGIN_WP_AT_LEAST_VERSION', '4.7.0' ); 21 define( 'GOPP_PLUGIN_WP_UP_TO_VERSION', '4. 7.3' );21 define( 'GOPP_PLUGIN_WP_UP_TO_VERSION', '4.8.0' ); 22 22 23 23 define( 'GOPP_REGEN_PDF_PREVIEWS_SLUG', 'gopp-regen-pdf-previews' ); … … 522 522 ?> 523 523 </p> 524 <?php if ( ( defined( 'GOPP_PLUGIN_DEBUG' ) && GOPP_PLUGIN_DEBUG ) || ! self::check_have_gs() ) : ?> 525 <?php require_once dirname( __FILE__ ) . '/includes/debug-gopp-image-editor-gs.php'; ?> 526 <?php DEBUG_GOPP_Image_Editor_GS::dump(); ?> 527 <?php endif; ?> 524 <?php if ( ( defined( 'GOPP_PLUGIN_DEBUG' ) && GOPP_PLUGIN_DEBUG ) || ! self::check_have_gs() ) : 525 self::load_gopp_image_editor_gs(); 526 require_once dirname( __FILE__ ) . '/includes/debug-gopp-image-editor-gs.php'; 527 DEBUG_GOPP_Image_Editor_GS::dump(); 528 endif; ?> 528 529 </form> 529 530 <?php -
gs-only-pdf-preview/tags/1.0.7/includes/class-gopp-image-editor-gs.php
r1638565 r1677886 181 181 return new WP_Error( 'image_save_error', __( 'No Ghostscript.', 'gs-only-pdf-preview' ) ); 182 182 } 183 $return_var = -1; 184 $output = array(); 183 185 exec( $cmd, $output, $return_var ); 184 186 … … 321 323 */ 322 324 protected static function test_gs_cmd( $cmd ) { 323 // Note if exec() has been disabled by means not reflected in function_exists() it may barf here and throw warnings but we don't care that much. 325 // Note if exec() has been disabled by means not reflected in function_exists() it may barf here and throw warnings so initial vars. 326 $return_var = -1; 327 $output = array(); 324 328 exec( self::escapeshellarg( $cmd ) . ' -dBATCH -dNOPAUSE -dNOPROMPT -dSAFER -v 2>&1', $output, $return_var ); 325 329 … … 363 367 // Do one test query first to see if it works. 364 368 $cmd = 'REG QUERY HKEY_LOCAL_MACHINE\\SOFTWARE 2>&1'; 369 $return_var = -1; 365 370 $output = array(); 366 371 exec( $cmd, $output, $return_var ); … … 813 818 $filename = $dirname . '/' . wp_unique_filename( $dirname, 'gopp_size.jpg' ); 814 819 if ( $cmd = self::gs_cmd( $this->get_gs_args( $filename ) ) ) { 820 $return_var = -1; 821 $output = array(); 815 822 exec( $cmd, $output, $return_var ); 816 823 if ( 0 === $return_var && ( $size = @ getimagesize( $filename ) ) ) { -
gs-only-pdf-preview/tags/1.0.7/includes/debug-gopp-image-editor-gs.php
r1638565 r1677886 9 9 class DEBUG_GOPP_Image_Editor_GS extends GOPP_Image_Editor_GS { 10 10 static function get_test_output() { 11 if ( self::is_exec_disabled() ) { 12 return array( -1, array( __( 'Exec disabled!', 'gs-only-pdf-preview' ) ) ); 13 } 11 14 if ( $cmd = self::gs_cmd( '-dBATCH -dNOPAUSE -dNOPROMPT -dSAFER -v' ) ) { 12 15 exec( $cmd, $output, $return_var ); … … 23 26 static function filter_gopp_image_gs_cmd_path() { return has_filter( 'gopp_image_gs_cmd_path' ); } 24 27 static function apply_filters_gopp_image_gs_cmd_path() { return apply_filters( 'gopp_image_gs_cmd_path', self::$gs_cmd_path, self::is_win() ); } 28 29 static function is_exec_disabled() { 30 $ini_get = ini_get( 'disable_functions' ); 31 if ( $ini_get && in_array( 'exec', array_map( 'trim', explode( ',', strtolower( $ini_get ) ) ), true ) ) { 32 return true; 33 } 34 if ( extension_loaded( 'suhosin' ) || extension_loaded( 'suhosin7' ) || ( version_compare( PHP_VERSION, '5.3', '>=' ) && ini_get( 'enable_dl' ) && @ dl( 'suhosin' ) ) ) { 35 $ini_get = ini_get( 'suhosin.executor.func.whitelist' ); 36 if ( $ini_get && in_array( 'exec', array_map( 'trim', explode( ',', strtolower( $ini_get ) ) ), true ) ) { 37 return false; 38 } 39 $ini_get = ini_get( 'suhosin.executor.func.blacklist' ); 40 if ( $ini_get && in_array( 'exec', array_map( 'trim', explode( ',', strtolower( $ini_get ) ) ), true ) ) { 41 return true; 42 } 43 } 44 return false; 45 } 25 46 26 47 static function dump() { -
gs-only-pdf-preview/tags/1.0.7/js/gs-only-pdf-preview.js
r1638565 r1677886 169 169 attachment_details2_with = '$1 || ( \'application\' === data.type && data.sizes )$2', 170 170 html_attachment_display_settings, 171 attachment_display_settings_re = /(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting ">)/,172 attachment_display_settings_with = '$1 || ( \'application\' === data.type && data.sizes )$2 ',171 attachment_display_settings_re = /(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting)("| align")/, 172 attachment_display_settings_with = '$1 || ( \'application\' === data.type && data.sizes )$2$3', 173 173 attachment_display_settings2_re = /(<# if \( data\.userSettings \) { #>\s+data-user-setting="imgsize"\s+<# } #>>)(\s+<#)/, 174 174 attachment_display_settings2_with = '$1\n<# if ( \'application\' === data.type ) { #>\n<option value="">\n' + gopp_plugin_params.document_link_only + '\n</option>\n<# } #>\n$2', -
gs-only-pdf-preview/tags/1.0.7/js/gs-only-pdf-preview.min.js
r1638573 r1677886 1 /*! gs-only-pdf-preview 1.0. 6 2017-04-16*/2 var gopp_plugin=gopp_plugin||{};!function(a){"use strict";gopp_plugin.regen_pdf_preview=function(){var b=a("#gopp_regen_pdf_previews"),c=a(".gopp_regen_pdf_previews_form",b);b.length&&a('input[type="submit"]',c).click(function(d){var e,f,g=a(this),h=a(".notice, .updated",b),i=a(gopp_plugin_params.please_wait_msg),j=parseInt(a("#poll_cnt",c).val(),10),k=a("#poll_nonce",c).val();g.hide(),a(".gopp_regen_pdf_previews_form_hide",b).hide(),h.hide(),a("h1",b).first().after(i),e=a("#gopp_progress",b),f=function(){a.post(ajaxurl,{action:"gopp_poll_regen_pdf_previews",cnt:j,poll_nonce:k},function(a){a&&a.msg&&e.html(a.msg),setTimeout(f,1e3*gopp_plugin_params.val.poll_interval)},"json")},a.browser&&a.browser.safari?(d.preventDefault(),a(".spinner",i).removeClass("is-active"),g.unbind("click"),setTimeout(function(){g.click()},0)):setTimeout(f,1e3*gopp_plugin_params.val.poll_interval)})},gopp_plugin.media_row_action=function(b,c,d,e){var f,g=a(b.target),h=g.parents(".row-actions").first(),i=h.parent(),j=g.next();return a(".gopp_response",i).remove(),j.addClass("is-active"),f=a.post({url:ajaxurl,data:{action:"gopp_media_row_action",id:c,nonce:d},dataType:"json",error:function(b,c,d){var e;j.removeClass("is-active"),e='<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+" ("+d+")</p></div>",h.after(a(e))},success:function(b){j.removeClass("is-active"),a(".gopp_response",i).remove(),b?(b.error?h.after(a('<div class="notice error gopp_response"><p>'+b.error+"</p></div>")):b.msg&&h.after(a('<div class="notice updated gopp_response"><p>'+b.msg+"</p></div>")),b.img&&a(".has-media-icon .media-icon",i).html(b.img)):h.after(a('<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+"</p></div>"))},timeout:1e3*gopp_plugin_params.val.min_time_limit}),f.fail(function(){j.removeClass("is-active")}),e&&(e.post_ret=f),!1},gopp_plugin.upload=function(){a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){var c,d,e;"gopp_regen_pdf_previews"===a(this).val()&&(c=a(b.target),d=c.parent(),a(".gopp_none",d).remove(),a(".spinner",d).remove(),e=a.makeArray(a('#the-list input[name="media[]"]:checked').map(function(){return this.value})),e.length?a(gopp_plugin_params.spinner).insertAfter(c):(b.preventDefault(),a(gopp_plugin_params.no_items_selected_msg).insertAfter(c).fadeOut(1e3,function(){a(this).remove()})))})})},gopp_plugin.upload_patch=function(){var b,c,d;return b=a("#tmpl-attachment-details-two-column"),!!b.length&&(c=b.html(),d=c.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting" data-setting="alt">)/,"$1 || data.sizes$2"),c!==d&&(b.html(d),!0))},gopp_plugin.post_patch=function(){var b,c,d,e,f,g,h,i="$1\n<# if ( 'application' === data.type ) { #>\n<option value=\"\">\n"+gopp_plugin_params.document_link_only+"\n</option>\n<# } #>\n$2";return!!(wp.media&&wp.media.editor&&wp.media.editor.send&&"function"==typeof wp.media.editor.send.attachment&&(b=a("#tmpl-attachment-details"),c=a("#tmpl-attachment-display-settings"),d=a("#tmpl-image-details"),b.length&&c.length&&d.length))&&(e=b.html(),f=e.replace(/(<# } else if \( 'image' === data\.type && data\.sizes \) { #>\s+<img src="{{ data\.size\.url }}" draggable="false" alt="" \/>)(\s+<# } else { #>)/,'$1\n<# } else if ( data.sizes && ( data.sizes.thumbnail || data.sizes.full ) ) { #>\n<img src="{{ ( data.sizes.thumbnail || data.sizes.full ).url }}" draggable="false" alt="" />\n$2'),e!==f&&(e=f,f=e.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting" data-setting="alt")/,"$1 || ( 'application' === data.type && data.sizes )$2"),e!==f&&(e=c.html(),g=e.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting ">)/,"$1 || ( 'application' === data.type && data.sizes )$2"),e!==g&&(e=g,g=e.replace(/(<# if \( data\.userSettings \) { #>\s+data-user-setting="imgsize"\s+<# } #>>)(\s+<#)/,i),e!==g&&(e=d.html(),h=e.replace(/(<# if \( data\.attachment && window\.imageEdit)( \) { #>)/,"$1 && 'image' === data.type $2"),e!==h&&(b.html(f),c.html(g),d.html(h),wp.media.editor.send.attachment=gopp_plugin.media_editor_send_attachment,!0))))))},gopp_plugin.media_editor_send_attachment=function(a,b){var c,d,e=b.caption;return wp.media.view.settings.captions||delete b.caption,a=wp.media.string.props(a,b),c={id:b.id,post_content:b.description,post_excerpt:e},a.linkUrl&&(c.url=a.linkUrl),a.link&&(c.link_to=a.link),"image"===b.type?(d=wp.media.string.image(a),_.each({align:"align",size:"image-size",alt:"image_alt"},function(b,d){a[d]&&(c[b]=a[d])})):"video"===b.type?d=wp.media.string.video(a,b):"audio"===b.type?d=wp.media.string.audio(a,b):(d=wp.media.string.link(a),c.post_title=a.title,b.sizes&&(b.alt&&(c.alt=b.alt),_.each({align:"align",size:"image-size",alt:"image_alt"},function(b,d){a[d]&&(c[b]=a[d])}))),wp.media.post("send-attachment-to-editor",{nonce:wp.media.view.settings.nonce.sendToEditor,attachment:c,html:d,post_id:wp.media.view.settings.post.id})},gopp_plugin.patch_39630=function(){var b,c,d=a("#tmpl-attachment");return!!d.length&&(b=d.html(),c=b.replace(/(<# } else if \( data\.sizes && )data\.sizes\.medium( \) { #>\s+<img src="{{ )data\.sizes\.medium(\.url }}" class="thumbnail" draggable="false" alt="" \/>\s+<# } else { #>)/,"$1( data.sizes.thumbnail || data.sizes.medium || data.sizes.full )$2( data.sizes.thumbnail || data.sizes.medium || data.sizes.full )$3"),b!==c&&(d.html(c),!0))},a(function(){gopp_plugin_params&&gopp_plugin_params.val&&(gopp_plugin_params.val.is_regen_pdf_preview?gopp_plugin_params.val.current_user_can_cap&&gopp_plugin.regen_pdf_preview():gopp_plugin_params.val.is_upload?(gopp_plugin_params.val.current_user_can_cap&&gopp_plugin.upload(),gopp_plugin.upload_patch(),gopp_plugin.patch_39630()):gopp_plugin_params.val.is_post&&(gopp_plugin.post_patch(),gopp_plugin.patch_39630()))})}(jQuery);1 /*! gs-only-pdf-preview 1.0.7 2017-06-13 */ 2 var gopp_plugin=gopp_plugin||{};!function(a){"use strict";gopp_plugin.regen_pdf_preview=function(){var b=a("#gopp_regen_pdf_previews"),c=a(".gopp_regen_pdf_previews_form",b);b.length&&a('input[type="submit"]',c).click(function(d){var e,f,g=a(this),h=a(".notice, .updated",b),i=a(gopp_plugin_params.please_wait_msg),j=parseInt(a("#poll_cnt",c).val(),10),k=a("#poll_nonce",c).val();g.hide(),a(".gopp_regen_pdf_previews_form_hide",b).hide(),h.hide(),a("h1",b).first().after(i),e=a("#gopp_progress",b),f=function(){a.post(ajaxurl,{action:"gopp_poll_regen_pdf_previews",cnt:j,poll_nonce:k},function(a){a&&a.msg&&e.html(a.msg),setTimeout(f,1e3*gopp_plugin_params.val.poll_interval)},"json")},a.browser&&a.browser.safari?(d.preventDefault(),a(".spinner",i).removeClass("is-active"),g.unbind("click"),setTimeout(function(){g.click()},0)):setTimeout(f,1e3*gopp_plugin_params.val.poll_interval)})},gopp_plugin.media_row_action=function(b,c,d,e){var f,g=a(b.target),h=g.parents(".row-actions").first(),i=h.parent(),j=g.next();return a(".gopp_response",i).remove(),j.addClass("is-active"),f=a.post({url:ajaxurl,data:{action:"gopp_media_row_action",id:c,nonce:d},dataType:"json",error:function(b,c,d){var e;j.removeClass("is-active"),e='<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+" ("+d+")</p></div>",h.after(a(e))},success:function(b){j.removeClass("is-active"),a(".gopp_response",i).remove(),b?(b.error?h.after(a('<div class="notice error gopp_response"><p>'+b.error+"</p></div>")):b.msg&&h.after(a('<div class="notice updated gopp_response"><p>'+b.msg+"</p></div>")),b.img&&a(".has-media-icon .media-icon",i).html(b.img)):h.after(a('<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+"</p></div>"))},timeout:1e3*gopp_plugin_params.val.min_time_limit}),f.fail(function(){j.removeClass("is-active")}),e&&(e.post_ret=f),!1},gopp_plugin.upload=function(){a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){var c,d,e;"gopp_regen_pdf_previews"===a(this).val()&&(c=a(b.target),d=c.parent(),a(".gopp_none",d).remove(),a(".spinner",d).remove(),e=a.makeArray(a('#the-list input[name="media[]"]:checked').map(function(){return this.value})),e.length?a(gopp_plugin_params.spinner).insertAfter(c):(b.preventDefault(),a(gopp_plugin_params.no_items_selected_msg).insertAfter(c).fadeOut(1e3,function(){a(this).remove()})))})})},gopp_plugin.upload_patch=function(){var b,c,d;return b=a("#tmpl-attachment-details-two-column"),!!b.length&&(c=b.html(),d=c.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting" data-setting="alt">)/,"$1 || data.sizes$2"),c!==d&&(b.html(d),!0))},gopp_plugin.post_patch=function(){var b,c,d,e,f,g,h,i="$1\n<# if ( 'application' === data.type ) { #>\n<option value=\"\">\n"+gopp_plugin_params.document_link_only+"\n</option>\n<# } #>\n$2";return!!(wp.media&&wp.media.editor&&wp.media.editor.send&&"function"==typeof wp.media.editor.send.attachment&&(b=a("#tmpl-attachment-details"),c=a("#tmpl-attachment-display-settings"),d=a("#tmpl-image-details"),b.length&&c.length&&d.length))&&(e=b.html(),f=e.replace(/(<# } else if \( 'image' === data\.type && data\.sizes \) { #>\s+<img src="{{ data\.size\.url }}" draggable="false" alt="" \/>)(\s+<# } else { #>)/,'$1\n<# } else if ( data.sizes && ( data.sizes.thumbnail || data.sizes.full ) ) { #>\n<img src="{{ ( data.sizes.thumbnail || data.sizes.full ).url }}" draggable="false" alt="" />\n$2'),e!==f&&(e=f,f=e.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting" data-setting="alt")/,"$1 || ( 'application' === data.type && data.sizes )$2"),e!==f&&(e=c.html(),g=e.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting)("| align")/,"$1 || ( 'application' === data.type && data.sizes )$2$3"),e!==g&&(e=g,g=e.replace(/(<# if \( data\.userSettings \) { #>\s+data-user-setting="imgsize"\s+<# } #>>)(\s+<#)/,i),e!==g&&(e=d.html(),h=e.replace(/(<# if \( data\.attachment && window\.imageEdit)( \) { #>)/,"$1 && 'image' === data.type $2"),e!==h&&(b.html(f),c.html(g),d.html(h),wp.media.editor.send.attachment=gopp_plugin.media_editor_send_attachment,!0))))))},gopp_plugin.media_editor_send_attachment=function(a,b){var c,d,e=b.caption;return wp.media.view.settings.captions||delete b.caption,a=wp.media.string.props(a,b),c={id:b.id,post_content:b.description,post_excerpt:e},a.linkUrl&&(c.url=a.linkUrl),a.link&&(c.link_to=a.link),"image"===b.type?(d=wp.media.string.image(a),_.each({align:"align",size:"image-size",alt:"image_alt"},function(b,d){a[d]&&(c[b]=a[d])})):"video"===b.type?d=wp.media.string.video(a,b):"audio"===b.type?d=wp.media.string.audio(a,b):(d=wp.media.string.link(a),c.post_title=a.title,b.sizes&&(b.alt&&(c.alt=b.alt),_.each({align:"align",size:"image-size",alt:"image_alt"},function(b,d){a[d]&&(c[b]=a[d])}))),wp.media.post("send-attachment-to-editor",{nonce:wp.media.view.settings.nonce.sendToEditor,attachment:c,html:d,post_id:wp.media.view.settings.post.id})},gopp_plugin.patch_39630=function(){var b,c,d=a("#tmpl-attachment");return!!d.length&&(b=d.html(),c=b.replace(/(<# } else if \( data\.sizes && )data\.sizes\.medium( \) { #>\s+<img src="{{ )data\.sizes\.medium(\.url }}" class="thumbnail" draggable="false" alt="" \/>\s+<# } else { #>)/,"$1( data.sizes.thumbnail || data.sizes.medium || data.sizes.full )$2( data.sizes.thumbnail || data.sizes.medium || data.sizes.full )$3"),b!==c&&(d.html(c),!0))},a(function(){gopp_plugin_params&&gopp_plugin_params.val&&(gopp_plugin_params.val.is_regen_pdf_preview?gopp_plugin_params.val.current_user_can_cap&&gopp_plugin.regen_pdf_preview():gopp_plugin_params.val.is_upload?(gopp_plugin_params.val.current_user_can_cap&&gopp_plugin.upload(),gopp_plugin.upload_patch(),gopp_plugin.patch_39630()):gopp_plugin_params.val.is_post&&(gopp_plugin.post_patch(),gopp_plugin.patch_39630()))})}(jQuery); -
gs-only-pdf-preview/tags/1.0.7/languages/gs-only-pdf-preview-fr_FR.po
r1638573 r1677886 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: GS Only PDF Preview 1.0. 6\n"5 "Project-Id-Version: GS Only PDF Preview 1.0.7\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gs-only-pdf-" 7 7 "preview\n" 8 "POT-Creation-Date: 2017-0 4-16 16:03+0100\n"9 "PO-Revision-Date: 2017-0 4-16 16:03+0100\n"8 "POT-Creation-Date: 2017-06-12 22:29+0100\n" 9 "PO-Revision-Date: 2017-06-12 22:29+0100\n" 10 10 "Last-Translator: gitlost <[email protected]>\n" 11 11 "Language-Team: \n" … … 14 14 "Content-Type: text/plain; charset=UTF-8\n" 15 15 "Content-Transfer-Encoding: 8bit\n" 16 "X-Generator: Poedit 1.8.9\n"16 "X-Generator: Poedit 2.0.1\n" 17 17 "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;" 18 18 "_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;" … … 154 154 msgstr "Vous pouvez aller de nouveau ci-dessous si vous voulez." 155 155 156 #: gs-only-pdf-preview.php:349 gs-only-pdf-preview.php:50 1157 #: gs-only-pdf-preview.php: 596156 #: gs-only-pdf-preview.php:349 gs-only-pdf-preview.php:504 157 #: gs-only-pdf-preview.php:600 158 158 msgid "Regenerate PDF Previews" 159 159 msgstr "Régénérer les aperçus de miniature de PDF" … … 163 163 msgstr "Régén. aperçus PDF" 164 164 165 #: gs-only-pdf-preview.php:363 gs-only-pdf-preview.php:46 5166 #: gs-only-pdf-preview.php:66 4165 #: gs-only-pdf-preview.php:363 gs-only-pdf-preview.php:468 166 #: gs-only-pdf-preview.php:668 167 167 msgid "Sorry, you are not allowed to access this page." 168 168 msgstr "" … … 170 170 "page. " 171 171 172 #: gs-only-pdf-preview.php:47 2172 #: gs-only-pdf-preview.php:475 173 173 msgid "GS Only PDF Preview - Regenerate PDF Previews" 174 174 msgstr "GS Only PDF Preview - Régénérer les aperçus de miniature de PDF." 175 175 176 #: gs-only-pdf-preview.php:4 77176 #: gs-only-pdf-preview.php:480 177 177 msgid "" 178 178 "This tool is for regenerating the thumbnail previews of PDFs, but no PDFs " … … 182 182 "fichier PDF n’a été téléchargé, donc il n’a rien à faire." 183 183 184 #: gs-only-pdf-preview.php:48 4184 #: gs-only-pdf-preview.php:487 185 185 msgid "" 186 186 "<strong>Warning: cannot set max execution time!</strong> The maximum time " … … 193 193 "donc éprouver l’écran blanc de mort (WSOD) en essayant ceci." 194 194 195 #: gs-only-pdf-preview.php:49 3195 #: gs-only-pdf-preview.php:496 196 196 msgid "Regenerate the thumbnail previews of PDFs uploaded to your system." 197 197 msgstr "" … … 200 200 201 201 #. translators: %s: formatted number of PDFs found. 202 #: gs-only-pdf-preview.php: 498202 #: gs-only-pdf-preview.php:501 203 203 msgid "<strong>%s</strong> PDF has been found." 204 204 msgid_plural "<strong>%s</strong> PDFs have been found." … … 207 207 208 208 #. translators: %s: formatted number (greater than 10) of PDFs found. 209 #: gs-only-pdf-preview.php:50 6209 #: gs-only-pdf-preview.php:509 210 210 msgid "Regenerating %s PDF previews can take a long time." 211 211 msgstr "" … … 213 213 214 214 #. translators: %s: url to the Media Library page in list mode. 215 #: gs-only-pdf-preview.php:5 18215 #: gs-only-pdf-preview.php:521 216 216 msgid "" 217 217 "Note that you can also regenerate PDF previews in batches or individually " … … 226 226 "<a href=\"%s\">mode de liste de la bibliothèque des médias</a>." 227 227 228 #: gs-only-pdf-preview.php:5 58228 #: gs-only-pdf-preview.php:562 229 229 msgid "Please wait..." 230 230 msgstr "S’il vous plaît attendre..." 231 231 232 #: gs-only-pdf-preview.php:56 2232 #: gs-only-pdf-preview.php:566 233 233 msgid "No items selected!" 234 234 msgstr "Aucun élément sélectionné !" 235 235 236 #: gs-only-pdf-preview.php:56 3236 #: gs-only-pdf-preview.php:567 237 237 msgid "Regenerate Preview ajax action not available!" 238 238 msgstr "" 239 239 "L’action de régénérer l’aperçu n’est pas disponible !" 240 240 241 #: gs-only-pdf-preview.php:5 67241 #: gs-only-pdf-preview.php:571 242 242 msgid "Document Link Only" 243 243 msgstr "Lien de document seulement" 244 244 245 245 #. translators: %s: attachment title 246 #: gs-only-pdf-preview.php:6 49246 #: gs-only-pdf-preview.php:653 247 247 msgid "Regenerate the PDF preview for “%s”" 248 248 msgstr "Régénérer l’aperçu de miniature de PDF pour “%s”" 249 249 250 #: gs-only-pdf-preview.php:65 0250 #: gs-only-pdf-preview.php:654 251 251 msgid "Regenerate Preview" 252 252 msgstr "Régénérer l’aperçu" 253 253 254 #: gs-only-pdf-preview.php:6 69254 #: gs-only-pdf-preview.php:673 255 255 msgid "Invalid nonce." 256 256 msgstr "Nonce invalide." 257 257 258 #: gs-only-pdf-preview.php:67 2258 #: gs-only-pdf-preview.php:676 259 259 msgid "Invalid ID." 260 260 msgstr "Identifiant invalide." 261 261 262 #: gs-only-pdf-preview.php:6 78262 #: gs-only-pdf-preview.php:682 263 263 msgid "Failed to generate the PDF preview." 264 264 msgstr "Échec de générer l’aperçu de miniature de PDF." 265 265 266 #: gs-only-pdf-preview.php:68 3266 #: gs-only-pdf-preview.php:687 267 267 msgid "" 268 268 "Successfully regenerated the PDF preview. It's best to refresh your browser " … … 273 273 "jour correctement." 274 274 275 #: gs-only-pdf-preview.php:68 5275 #: gs-only-pdf-preview.php:689 276 276 msgid "" 277 277 "Successfully regenerated the PDF preview. You will need to refresh your " … … 283 283 #. translators: %1$d: percentage of PDF previews completed; %2$d: completed 284 284 #. count. 285 #: gs-only-pdf-preview.php:71 4285 #: gs-only-pdf-preview.php:718 286 286 msgid "%d%% (%d)" 287 287 msgstr "%d%% (%d)" … … 299 299 msgstr "Pas de Ghostscript." 300 300 301 #: includes/class-gopp-image-editor-gs.php:18 7301 #: includes/class-gopp-image-editor-gs.php:189 302 302 msgid "Image Editor Save Failed" 303 303 msgstr "L’enregistrement de l’éditeur d’images a échoué." 304 304 305 #: includes/class-gopp-image-editor-gs.php:19 2305 #: includes/class-gopp-image-editor-gs.php:194 306 306 msgid "Could not read image size." 307 307 msgstr "Impossible de lire la taille de l’image." 308 308 309 #: includes/class-gopp-image-editor-gs.php:23 0309 #: includes/class-gopp-image-editor-gs.php:232 310 310 msgid "Loading from URL not supported." 311 311 msgstr "Chargement à partir de l’URL non pris en charge." 312 312 313 #: includes/class-gopp-image-editor-gs.php:23 5314 #: includes/class-gopp-image-editor-gs.php:24 1313 #: includes/class-gopp-image-editor-gs.php:237 314 #: includes/class-gopp-image-editor-gs.php:243 315 315 msgid "Unsupported file name." 316 316 msgstr "Nom du fichier non supporté." 317 317 318 #: includes/class-gopp-image-editor-gs.php:25 1318 #: includes/class-gopp-image-editor-gs.php:253 319 319 msgid "File doesn’t exist?" 320 320 msgstr "Le fichier n’existe pas ?" 321 321 322 #: includes/class-gopp-image-editor-gs.php:2 58322 #: includes/class-gopp-image-editor-gs.php:260 323 323 msgid "File is not a PDF." 324 324 msgstr "Le fichier n’est pas un PDF ." 325 325 326 #: includes/class-gopp-image-editor-gs.php:64 2326 #: includes/class-gopp-image-editor-gs.php:647 327 327 msgid "Attempted to set PDF preview resolution to an invalid value." 328 328 msgstr "" … … 330 330 "valeur non valide." 331 331 332 #: includes/class-gopp-image-editor-gs.php: 697332 #: includes/class-gopp-image-editor-gs.php:702 333 333 msgid "Attempted to set PDF preview page to an invalid value." 334 334 msgstr "" … … 336 336 "non valide." 337 337 338 #: includes/class-gopp-image-editor-gs.php:7 16339 #: includes/class-gopp-image-editor-gs.php:7 37340 #: includes/class-gopp-image-editor-gs.php:7 56341 #: includes/class-gopp-image-editor-gs.php:7 69342 #: includes/class-gopp-image-editor-gs.php:78 3343 #: includes/class-gopp-image-editor-gs.php: 796338 #: includes/class-gopp-image-editor-gs.php:721 339 #: includes/class-gopp-image-editor-gs.php:742 340 #: includes/class-gopp-image-editor-gs.php:761 341 #: includes/class-gopp-image-editor-gs.php:774 342 #: includes/class-gopp-image-editor-gs.php:788 343 #: includes/class-gopp-image-editor-gs.php:801 344 344 msgid "Unsupported operation." 345 345 msgstr "Opération non supportée." 346 346 347 #: includes/debug-gopp-image-editor-gs.php:15 347 #: includes/debug-gopp-image-editor-gs.php:12 348 msgid "Exec disabled!" 349 msgstr "Exec désactivé !" 350 351 #: includes/debug-gopp-image-editor-gs.php:18 348 352 msgid "Ghostscript command not found!" 349 353 msgstr "Commande Ghostscript introuvable !" -
gs-only-pdf-preview/tags/1.0.7/languages/gs-only-pdf-preview.pot
r1638573 r1677886 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: GS Only PDF Preview 1.0. 6\n"5 "Project-Id-Version: GS Only PDF Preview 1.0.7\n" 6 6 "Report-Msgid-Bugs-To: " 7 7 "https://wordpress.org/support/plugin/gs-only-pdf-preview\n" … … 132 132 133 133 #: gs-only-pdf-preview.php:349 gs-only-pdf-preview.php:504 134 #: gs-only-pdf-preview.php: 599134 #: gs-only-pdf-preview.php:600 135 135 msgid "Regenerate PDF Previews" 136 136 msgstr "" … … 141 141 142 142 #: gs-only-pdf-preview.php:363 gs-only-pdf-preview.php:468 143 #: gs-only-pdf-preview.php:66 7143 #: gs-only-pdf-preview.php:668 144 144 msgid "Sorry, you are not allowed to access this page." 145 145 msgstr "" … … 187 187 msgstr "" 188 188 189 #: gs-only-pdf-preview.php:56 1189 #: gs-only-pdf-preview.php:562 190 190 msgid "Please wait..." 191 191 msgstr "" 192 192 193 #: gs-only-pdf-preview.php:56 5193 #: gs-only-pdf-preview.php:566 194 194 msgid "No items selected!" 195 195 msgstr "" 196 196 197 #: gs-only-pdf-preview.php:56 6197 #: gs-only-pdf-preview.php:567 198 198 msgid "Regenerate Preview ajax action not available!" 199 199 msgstr "" 200 200 201 #: gs-only-pdf-preview.php:57 0201 #: gs-only-pdf-preview.php:571 202 202 msgid "Document Link Only" 203 203 msgstr "" 204 204 205 #: gs-only-pdf-preview.php:65 2205 #: gs-only-pdf-preview.php:653 206 206 #. translators: %s: attachment title 207 207 msgid "Regenerate the PDF preview for “%s”" 208 208 msgstr "" 209 209 210 #: gs-only-pdf-preview.php:65 3210 #: gs-only-pdf-preview.php:654 211 211 msgid "Regenerate Preview" 212 212 msgstr "" 213 213 214 #: gs-only-pdf-preview.php:67 2214 #: gs-only-pdf-preview.php:673 215 215 msgid "Invalid nonce." 216 216 msgstr "" 217 217 218 #: gs-only-pdf-preview.php:67 5218 #: gs-only-pdf-preview.php:676 219 219 msgid "Invalid ID." 220 220 msgstr "" 221 221 222 #: gs-only-pdf-preview.php:68 1222 #: gs-only-pdf-preview.php:682 223 223 msgid "Failed to generate the PDF preview." 224 224 msgstr "" 225 225 226 #: gs-only-pdf-preview.php:68 6226 #: gs-only-pdf-preview.php:687 227 227 msgid "" 228 228 "Successfully regenerated the PDF preview. It's best to refresh your browser " … … 230 230 msgstr "" 231 231 232 #: gs-only-pdf-preview.php:68 8232 #: gs-only-pdf-preview.php:689 233 233 msgid "" 234 234 "Successfully regenerated the PDF preview. You will need to refresh your " … … 236 236 msgstr "" 237 237 238 #: gs-only-pdf-preview.php:71 7238 #: gs-only-pdf-preview.php:718 239 239 #. translators: %1$d: percentage of PDF previews completed; %2$d: completed 240 240 #. count. … … 254 254 msgstr "" 255 255 256 #: includes/class-gopp-image-editor-gs.php:18 7256 #: includes/class-gopp-image-editor-gs.php:189 257 257 msgid "Image Editor Save Failed" 258 258 msgstr "" 259 259 260 #: includes/class-gopp-image-editor-gs.php:19 2260 #: includes/class-gopp-image-editor-gs.php:194 261 261 msgid "Could not read image size." 262 262 msgstr "" 263 263 264 #: includes/class-gopp-image-editor-gs.php:23 0264 #: includes/class-gopp-image-editor-gs.php:232 265 265 msgid "Loading from URL not supported." 266 266 msgstr "" 267 267 268 #: includes/class-gopp-image-editor-gs.php:23 5269 #: includes/class-gopp-image-editor-gs.php:24 1268 #: includes/class-gopp-image-editor-gs.php:237 269 #: includes/class-gopp-image-editor-gs.php:243 270 270 msgid "Unsupported file name." 271 271 msgstr "" 272 272 273 #: includes/class-gopp-image-editor-gs.php:25 1273 #: includes/class-gopp-image-editor-gs.php:253 274 274 msgid "File doesn’t exist?" 275 275 msgstr "" 276 276 277 #: includes/class-gopp-image-editor-gs.php:2 58277 #: includes/class-gopp-image-editor-gs.php:260 278 278 msgid "File is not a PDF." 279 279 msgstr "" 280 280 281 #: includes/class-gopp-image-editor-gs.php:64 2281 #: includes/class-gopp-image-editor-gs.php:647 282 282 msgid "Attempted to set PDF preview resolution to an invalid value." 283 283 msgstr "" 284 284 285 #: includes/class-gopp-image-editor-gs.php: 697285 #: includes/class-gopp-image-editor-gs.php:702 286 286 msgid "Attempted to set PDF preview page to an invalid value." 287 287 msgstr "" 288 288 289 #: includes/class-gopp-image-editor-gs.php:7 16290 #: includes/class-gopp-image-editor-gs.php:7 37291 #: includes/class-gopp-image-editor-gs.php:7 56292 #: includes/class-gopp-image-editor-gs.php:7 69293 #: includes/class-gopp-image-editor-gs.php:78 3294 #: includes/class-gopp-image-editor-gs.php: 796289 #: includes/class-gopp-image-editor-gs.php:721 290 #: includes/class-gopp-image-editor-gs.php:742 291 #: includes/class-gopp-image-editor-gs.php:761 292 #: includes/class-gopp-image-editor-gs.php:774 293 #: includes/class-gopp-image-editor-gs.php:788 294 #: includes/class-gopp-image-editor-gs.php:801 295 295 msgid "Unsupported operation." 296 296 msgstr "" 297 297 298 #: includes/debug-gopp-image-editor-gs.php:15 298 #: includes/debug-gopp-image-editor-gs.php:12 299 msgid "Exec disabled!" 300 msgstr "" 301 302 #: includes/debug-gopp-image-editor-gs.php:18 299 303 msgid "Ghostscript command not found!" 300 304 msgstr "" -
gs-only-pdf-preview/tags/1.0.7/readme.txt
r1638573 r1677886 3 3 Tags: Ghostscript, PDF, PDF Preview, Ghostscript Only 4 4 Requires at least: 4.7.0 5 Tested up to: 4. 7.36 Stable tag: 1.0. 65 Tested up to: 4.8.0 6 Stable tag: 1.0.7 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 12 12 == Description == 13 13 14 The plugin pre-empts the standard WordPress 4.7 PDF preview production process (which uses the PHP extension [`Imagick`](http://php.net/manual/en/book.imagick.php)) to call [Ghostscript](https://ghostscript.com/) directly to produce the preview.14 The plugin pre-empts the standard WordPress 4.7/4.8 PDF preview production process (which uses the PHP extension [`Imagick`](http://php.net/manual/en/book.imagick.php)) to call [Ghostscript](https://ghostscript.com/) directly to produce the preview. 15 15 16 16 This means that only Ghostscript is required on the server. Neither the PHP module `Imagick` nor the server package [`ImageMagick`](https://www.imagemagick.org/script/index.php) is needed or used (though it's fine if they're installed anyway, and if they are they'll be used by WP (unless you override it) to produce the intermediate sizes of the preview). … … 20 20 The plugin was prompted by the `WP_Image_Editor_Imagick_External` demonstration class uploaded to the WP Trac ticket [#39262 Fall back to ImageMagick command line when the pecl imagic is not available on the server](https://core.trac.wordpress.org/ticket/39262) by [Hristo Pandjarov](https://profiles.wordpress.org/hristo-sg), and by the wish to solve the WP Trac ticket [#39216 PDFs with non-opaque alpha channels can result in previews with black backgrounds.](https://core.trac.wordpress.org/ticket/39216), which particularly affects PDFs with CMYK color spaces (common in the print world). 21 21 22 The plugin by-passes (as far as PDF previews are concerned) #39216, and also by-passes the related issue [#39331 unsharpMaskImage in Imagick's thumbnail_image is not compatible with CMYK jpegs.](https://core.trac.wordpress.org/ticket/39331), as the preview jpegs produced directly by Ghostscript use sRGB color spaces.22 The plugin by-passes (as far as PDF previews are concerned) #39216, and also by-passes the related issue [#39331 unsharpMaskImage in Imagick's thumbnail_image is not compatible with CMYK JPEGs.](https://core.trac.wordpress.org/ticket/39331), as the preview JPEGs produced directly by Ghostscript use sRGB color spaces. 23 23 24 24 = Limitations = … … 40 40 = Size = 41 41 42 On jpeg thumbnail size it appears to be comparable (though it depends on the PDF), maybe a bit larger on average. To mitigate this the default jpeg quality for the PDF preview has been lowered to 70 (from 82), which results in some extra "ringing" (speckles around letters) but the previews tested remain very readable. Note that this only affects the "full" PDF thumbnail - the intermediate-sized thumbnails as produced by `Imagick` or `GD` and any other non-PDF images remain at the standard jpegquality of 82. You can use the WP filter [`wp_editor_set_quality`](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/) to override this, for instance to restore the quality to 82 add to your theme's "functions.php":42 On JPEG thumbnail size it appears to be comparable (though it depends on the PDF), maybe a bit larger on average. To mitigate this the default JPEG quality for the PDF preview has been lowered to 70 (from 82), which results in some extra "ringing" (speckles around letters) but the previews tested remain very readable. Note that this only affects the "full" PDF thumbnail - the intermediate-sized thumbnails as produced by `Imagick` or `GD` and any other non-PDF images remain at the standard JPEG quality of 82. You can use the WP filter [`wp_editor_set_quality`](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/) to override this, for instance to restore the quality to 82 add to your theme's "functions.php": 43 43 44 44 function mytheme_wp_editor_set_quality( $quality, $mime_type ) { … … 52 52 = Quality = 53 53 54 Eyeballing based on very limited data, ie anecdotally, the previews seem to be of superior definition with less artifacts (even with the jpegquality reduced to 70), and more faithful to the original colours.54 Eyeballing based on very limited data, ie anecdotally, the previews seem to be of superior definition with less artifacts (even with the JPEG quality reduced to 70), and more faithful to the original colours. 55 55 56 56 = Tool = … … 68 68 A google-cheating schoolboy French translation is supplied. 69 69 70 The plugin runs on WP 4.7.0 to 4. 7.3, and requires Ghostscript to be installed on the server. The plugin should run on PHP 5.2.17 to 7.1, and on both Unix and Windows servers.70 The plugin runs on WP 4.7.0 to 4.8.0, and requires Ghostscript to be installed on the server. The plugin should run on PHP 5.2.17 to 7.1, and on both Unix and Windows servers. 71 71 72 72 The project is on [github](https://github.com/gitlost/gs-only-pdf-preview). … … 139 139 140 140 == Changelog == 141 142 = 1.0.7 (13 Jun 2017) = 143 * Fix regex for patching "Align" select of Attachment Display Settings after core changeset [40640]. 144 * Rejig tests. 145 * WP 4.8.0 compatible. 141 146 142 147 = 1.0.6 (16 Apr 2017) = … … 153 158 * Override get_size() to work if loaded. 154 159 * Enable "Alt Text" on Attachment Details. 155 * WP 4.7.3 compatible 160 * WP 4.7.3 compatible. 156 161 157 162 = 1.0.4 (13 Feb 2017) = … … 169 174 * Patch WP to allow preview image linking in Add Media (#39618). 170 175 * Patch WP to use thumbnail or medium sized thumbnails in Media Library (#39630). 171 * WP 4.7.2 compatible 176 * WP 4.7.2 compatible. 172 177 173 178 = 1.0.1 (20 Jan 2017) = … … 182 187 == Upgrade Notice == 183 188 189 = 1.0.7 = 190 Tested with WordPress 4.8.0, with compatibility fix for patching "Align" select of Attachment Display Settings. 191 184 192 = 1.0.6 = 185 193 Keeps backward-compatibility for linked thumbnails. -
gs-only-pdf-preview/trunk/gs-only-pdf-preview.php
r1638573 r1677886 4 4 * Plugin URI: https://github.com/gitlost/gs-only-pdf-preview 5 5 * Description: Uses Ghostscript directly to generate PDF previews. 6 * Version: 1.0. 66 * Version: 1.0.7 7 7 * Author: gitlost 8 8 * Author URI: https://profiles.wordpress.org/gitlost … … 17 17 18 18 // These need to be synced with "readme.txt". 19 define( 'GOPP_PLUGIN_VERSION', '1.0. 6' ); // Sync also "package.json" and "language/gs-only-pdf-preview.pot".19 define( 'GOPP_PLUGIN_VERSION', '1.0.7' ); // Sync also "package.json" and "language/gs-only-pdf-preview.pot". 20 20 define( 'GOPP_PLUGIN_WP_AT_LEAST_VERSION', '4.7.0' ); 21 define( 'GOPP_PLUGIN_WP_UP_TO_VERSION', '4. 7.3' );21 define( 'GOPP_PLUGIN_WP_UP_TO_VERSION', '4.8.0' ); 22 22 23 23 define( 'GOPP_REGEN_PDF_PREVIEWS_SLUG', 'gopp-regen-pdf-previews' ); … … 522 522 ?> 523 523 </p> 524 <?php if ( ( defined( 'GOPP_PLUGIN_DEBUG' ) && GOPP_PLUGIN_DEBUG ) || ! self::check_have_gs() ) : ?> 525 <?php require_once dirname( __FILE__ ) . '/includes/debug-gopp-image-editor-gs.php'; ?> 526 <?php DEBUG_GOPP_Image_Editor_GS::dump(); ?> 527 <?php endif; ?> 524 <?php if ( ( defined( 'GOPP_PLUGIN_DEBUG' ) && GOPP_PLUGIN_DEBUG ) || ! self::check_have_gs() ) : 525 self::load_gopp_image_editor_gs(); 526 require_once dirname( __FILE__ ) . '/includes/debug-gopp-image-editor-gs.php'; 527 DEBUG_GOPP_Image_Editor_GS::dump(); 528 endif; ?> 528 529 </form> 529 530 <?php -
gs-only-pdf-preview/trunk/includes/class-gopp-image-editor-gs.php
r1638565 r1677886 181 181 return new WP_Error( 'image_save_error', __( 'No Ghostscript.', 'gs-only-pdf-preview' ) ); 182 182 } 183 $return_var = -1; 184 $output = array(); 183 185 exec( $cmd, $output, $return_var ); 184 186 … … 321 323 */ 322 324 protected static function test_gs_cmd( $cmd ) { 323 // Note if exec() has been disabled by means not reflected in function_exists() it may barf here and throw warnings but we don't care that much. 325 // Note if exec() has been disabled by means not reflected in function_exists() it may barf here and throw warnings so initial vars. 326 $return_var = -1; 327 $output = array(); 324 328 exec( self::escapeshellarg( $cmd ) . ' -dBATCH -dNOPAUSE -dNOPROMPT -dSAFER -v 2>&1', $output, $return_var ); 325 329 … … 363 367 // Do one test query first to see if it works. 364 368 $cmd = 'REG QUERY HKEY_LOCAL_MACHINE\\SOFTWARE 2>&1'; 369 $return_var = -1; 365 370 $output = array(); 366 371 exec( $cmd, $output, $return_var ); … … 813 818 $filename = $dirname . '/' . wp_unique_filename( $dirname, 'gopp_size.jpg' ); 814 819 if ( $cmd = self::gs_cmd( $this->get_gs_args( $filename ) ) ) { 820 $return_var = -1; 821 $output = array(); 815 822 exec( $cmd, $output, $return_var ); 816 823 if ( 0 === $return_var && ( $size = @ getimagesize( $filename ) ) ) { -
gs-only-pdf-preview/trunk/includes/debug-gopp-image-editor-gs.php
r1638565 r1677886 9 9 class DEBUG_GOPP_Image_Editor_GS extends GOPP_Image_Editor_GS { 10 10 static function get_test_output() { 11 if ( self::is_exec_disabled() ) { 12 return array( -1, array( __( 'Exec disabled!', 'gs-only-pdf-preview' ) ) ); 13 } 11 14 if ( $cmd = self::gs_cmd( '-dBATCH -dNOPAUSE -dNOPROMPT -dSAFER -v' ) ) { 12 15 exec( $cmd, $output, $return_var ); … … 23 26 static function filter_gopp_image_gs_cmd_path() { return has_filter( 'gopp_image_gs_cmd_path' ); } 24 27 static function apply_filters_gopp_image_gs_cmd_path() { return apply_filters( 'gopp_image_gs_cmd_path', self::$gs_cmd_path, self::is_win() ); } 28 29 static function is_exec_disabled() { 30 $ini_get = ini_get( 'disable_functions' ); 31 if ( $ini_get && in_array( 'exec', array_map( 'trim', explode( ',', strtolower( $ini_get ) ) ), true ) ) { 32 return true; 33 } 34 if ( extension_loaded( 'suhosin' ) || extension_loaded( 'suhosin7' ) || ( version_compare( PHP_VERSION, '5.3', '>=' ) && ini_get( 'enable_dl' ) && @ dl( 'suhosin' ) ) ) { 35 $ini_get = ini_get( 'suhosin.executor.func.whitelist' ); 36 if ( $ini_get && in_array( 'exec', array_map( 'trim', explode( ',', strtolower( $ini_get ) ) ), true ) ) { 37 return false; 38 } 39 $ini_get = ini_get( 'suhosin.executor.func.blacklist' ); 40 if ( $ini_get && in_array( 'exec', array_map( 'trim', explode( ',', strtolower( $ini_get ) ) ), true ) ) { 41 return true; 42 } 43 } 44 return false; 45 } 25 46 26 47 static function dump() { -
gs-only-pdf-preview/trunk/js/gs-only-pdf-preview.js
r1638565 r1677886 169 169 attachment_details2_with = '$1 || ( \'application\' === data.type && data.sizes )$2', 170 170 html_attachment_display_settings, 171 attachment_display_settings_re = /(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting ">)/,172 attachment_display_settings_with = '$1 || ( \'application\' === data.type && data.sizes )$2 ',171 attachment_display_settings_re = /(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting)("| align")/, 172 attachment_display_settings_with = '$1 || ( \'application\' === data.type && data.sizes )$2$3', 173 173 attachment_display_settings2_re = /(<# if \( data\.userSettings \) { #>\s+data-user-setting="imgsize"\s+<# } #>>)(\s+<#)/, 174 174 attachment_display_settings2_with = '$1\n<# if ( \'application\' === data.type ) { #>\n<option value="">\n' + gopp_plugin_params.document_link_only + '\n</option>\n<# } #>\n$2', -
gs-only-pdf-preview/trunk/js/gs-only-pdf-preview.min.js
r1638573 r1677886 1 /*! gs-only-pdf-preview 1.0. 6 2017-04-16*/2 var gopp_plugin=gopp_plugin||{};!function(a){"use strict";gopp_plugin.regen_pdf_preview=function(){var b=a("#gopp_regen_pdf_previews"),c=a(".gopp_regen_pdf_previews_form",b);b.length&&a('input[type="submit"]',c).click(function(d){var e,f,g=a(this),h=a(".notice, .updated",b),i=a(gopp_plugin_params.please_wait_msg),j=parseInt(a("#poll_cnt",c).val(),10),k=a("#poll_nonce",c).val();g.hide(),a(".gopp_regen_pdf_previews_form_hide",b).hide(),h.hide(),a("h1",b).first().after(i),e=a("#gopp_progress",b),f=function(){a.post(ajaxurl,{action:"gopp_poll_regen_pdf_previews",cnt:j,poll_nonce:k},function(a){a&&a.msg&&e.html(a.msg),setTimeout(f,1e3*gopp_plugin_params.val.poll_interval)},"json")},a.browser&&a.browser.safari?(d.preventDefault(),a(".spinner",i).removeClass("is-active"),g.unbind("click"),setTimeout(function(){g.click()},0)):setTimeout(f,1e3*gopp_plugin_params.val.poll_interval)})},gopp_plugin.media_row_action=function(b,c,d,e){var f,g=a(b.target),h=g.parents(".row-actions").first(),i=h.parent(),j=g.next();return a(".gopp_response",i).remove(),j.addClass("is-active"),f=a.post({url:ajaxurl,data:{action:"gopp_media_row_action",id:c,nonce:d},dataType:"json",error:function(b,c,d){var e;j.removeClass("is-active"),e='<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+" ("+d+")</p></div>",h.after(a(e))},success:function(b){j.removeClass("is-active"),a(".gopp_response",i).remove(),b?(b.error?h.after(a('<div class="notice error gopp_response"><p>'+b.error+"</p></div>")):b.msg&&h.after(a('<div class="notice updated gopp_response"><p>'+b.msg+"</p></div>")),b.img&&a(".has-media-icon .media-icon",i).html(b.img)):h.after(a('<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+"</p></div>"))},timeout:1e3*gopp_plugin_params.val.min_time_limit}),f.fail(function(){j.removeClass("is-active")}),e&&(e.post_ret=f),!1},gopp_plugin.upload=function(){a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){var c,d,e;"gopp_regen_pdf_previews"===a(this).val()&&(c=a(b.target),d=c.parent(),a(".gopp_none",d).remove(),a(".spinner",d).remove(),e=a.makeArray(a('#the-list input[name="media[]"]:checked').map(function(){return this.value})),e.length?a(gopp_plugin_params.spinner).insertAfter(c):(b.preventDefault(),a(gopp_plugin_params.no_items_selected_msg).insertAfter(c).fadeOut(1e3,function(){a(this).remove()})))})})},gopp_plugin.upload_patch=function(){var b,c,d;return b=a("#tmpl-attachment-details-two-column"),!!b.length&&(c=b.html(),d=c.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting" data-setting="alt">)/,"$1 || data.sizes$2"),c!==d&&(b.html(d),!0))},gopp_plugin.post_patch=function(){var b,c,d,e,f,g,h,i="$1\n<# if ( 'application' === data.type ) { #>\n<option value=\"\">\n"+gopp_plugin_params.document_link_only+"\n</option>\n<# } #>\n$2";return!!(wp.media&&wp.media.editor&&wp.media.editor.send&&"function"==typeof wp.media.editor.send.attachment&&(b=a("#tmpl-attachment-details"),c=a("#tmpl-attachment-display-settings"),d=a("#tmpl-image-details"),b.length&&c.length&&d.length))&&(e=b.html(),f=e.replace(/(<# } else if \( 'image' === data\.type && data\.sizes \) { #>\s+<img src="{{ data\.size\.url }}" draggable="false" alt="" \/>)(\s+<# } else { #>)/,'$1\n<# } else if ( data.sizes && ( data.sizes.thumbnail || data.sizes.full ) ) { #>\n<img src="{{ ( data.sizes.thumbnail || data.sizes.full ).url }}" draggable="false" alt="" />\n$2'),e!==f&&(e=f,f=e.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting" data-setting="alt")/,"$1 || ( 'application' === data.type && data.sizes )$2"),e!==f&&(e=c.html(),g=e.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting ">)/,"$1 || ( 'application' === data.type && data.sizes )$2"),e!==g&&(e=g,g=e.replace(/(<# if \( data\.userSettings \) { #>\s+data-user-setting="imgsize"\s+<# } #>>)(\s+<#)/,i),e!==g&&(e=d.html(),h=e.replace(/(<# if \( data\.attachment && window\.imageEdit)( \) { #>)/,"$1 && 'image' === data.type $2"),e!==h&&(b.html(f),c.html(g),d.html(h),wp.media.editor.send.attachment=gopp_plugin.media_editor_send_attachment,!0))))))},gopp_plugin.media_editor_send_attachment=function(a,b){var c,d,e=b.caption;return wp.media.view.settings.captions||delete b.caption,a=wp.media.string.props(a,b),c={id:b.id,post_content:b.description,post_excerpt:e},a.linkUrl&&(c.url=a.linkUrl),a.link&&(c.link_to=a.link),"image"===b.type?(d=wp.media.string.image(a),_.each({align:"align",size:"image-size",alt:"image_alt"},function(b,d){a[d]&&(c[b]=a[d])})):"video"===b.type?d=wp.media.string.video(a,b):"audio"===b.type?d=wp.media.string.audio(a,b):(d=wp.media.string.link(a),c.post_title=a.title,b.sizes&&(b.alt&&(c.alt=b.alt),_.each({align:"align",size:"image-size",alt:"image_alt"},function(b,d){a[d]&&(c[b]=a[d])}))),wp.media.post("send-attachment-to-editor",{nonce:wp.media.view.settings.nonce.sendToEditor,attachment:c,html:d,post_id:wp.media.view.settings.post.id})},gopp_plugin.patch_39630=function(){var b,c,d=a("#tmpl-attachment");return!!d.length&&(b=d.html(),c=b.replace(/(<# } else if \( data\.sizes && )data\.sizes\.medium( \) { #>\s+<img src="{{ )data\.sizes\.medium(\.url }}" class="thumbnail" draggable="false" alt="" \/>\s+<# } else { #>)/,"$1( data.sizes.thumbnail || data.sizes.medium || data.sizes.full )$2( data.sizes.thumbnail || data.sizes.medium || data.sizes.full )$3"),b!==c&&(d.html(c),!0))},a(function(){gopp_plugin_params&&gopp_plugin_params.val&&(gopp_plugin_params.val.is_regen_pdf_preview?gopp_plugin_params.val.current_user_can_cap&&gopp_plugin.regen_pdf_preview():gopp_plugin_params.val.is_upload?(gopp_plugin_params.val.current_user_can_cap&&gopp_plugin.upload(),gopp_plugin.upload_patch(),gopp_plugin.patch_39630()):gopp_plugin_params.val.is_post&&(gopp_plugin.post_patch(),gopp_plugin.patch_39630()))})}(jQuery);1 /*! gs-only-pdf-preview 1.0.7 2017-06-13 */ 2 var gopp_plugin=gopp_plugin||{};!function(a){"use strict";gopp_plugin.regen_pdf_preview=function(){var b=a("#gopp_regen_pdf_previews"),c=a(".gopp_regen_pdf_previews_form",b);b.length&&a('input[type="submit"]',c).click(function(d){var e,f,g=a(this),h=a(".notice, .updated",b),i=a(gopp_plugin_params.please_wait_msg),j=parseInt(a("#poll_cnt",c).val(),10),k=a("#poll_nonce",c).val();g.hide(),a(".gopp_regen_pdf_previews_form_hide",b).hide(),h.hide(),a("h1",b).first().after(i),e=a("#gopp_progress",b),f=function(){a.post(ajaxurl,{action:"gopp_poll_regen_pdf_previews",cnt:j,poll_nonce:k},function(a){a&&a.msg&&e.html(a.msg),setTimeout(f,1e3*gopp_plugin_params.val.poll_interval)},"json")},a.browser&&a.browser.safari?(d.preventDefault(),a(".spinner",i).removeClass("is-active"),g.unbind("click"),setTimeout(function(){g.click()},0)):setTimeout(f,1e3*gopp_plugin_params.val.poll_interval)})},gopp_plugin.media_row_action=function(b,c,d,e){var f,g=a(b.target),h=g.parents(".row-actions").first(),i=h.parent(),j=g.next();return a(".gopp_response",i).remove(),j.addClass("is-active"),f=a.post({url:ajaxurl,data:{action:"gopp_media_row_action",id:c,nonce:d},dataType:"json",error:function(b,c,d){var e;j.removeClass("is-active"),e='<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+" ("+d+")</p></div>",h.after(a(e))},success:function(b){j.removeClass("is-active"),a(".gopp_response",i).remove(),b?(b.error?h.after(a('<div class="notice error gopp_response"><p>'+b.error+"</p></div>")):b.msg&&h.after(a('<div class="notice updated gopp_response"><p>'+b.msg+"</p></div>")),b.img&&a(".has-media-icon .media-icon",i).html(b.img)):h.after(a('<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+"</p></div>"))},timeout:1e3*gopp_plugin_params.val.min_time_limit}),f.fail(function(){j.removeClass("is-active")}),e&&(e.post_ret=f),!1},gopp_plugin.upload=function(){a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){var c,d,e;"gopp_regen_pdf_previews"===a(this).val()&&(c=a(b.target),d=c.parent(),a(".gopp_none",d).remove(),a(".spinner",d).remove(),e=a.makeArray(a('#the-list input[name="media[]"]:checked').map(function(){return this.value})),e.length?a(gopp_plugin_params.spinner).insertAfter(c):(b.preventDefault(),a(gopp_plugin_params.no_items_selected_msg).insertAfter(c).fadeOut(1e3,function(){a(this).remove()})))})})},gopp_plugin.upload_patch=function(){var b,c,d;return b=a("#tmpl-attachment-details-two-column"),!!b.length&&(c=b.html(),d=c.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting" data-setting="alt">)/,"$1 || data.sizes$2"),c!==d&&(b.html(d),!0))},gopp_plugin.post_patch=function(){var b,c,d,e,f,g,h,i="$1\n<# if ( 'application' === data.type ) { #>\n<option value=\"\">\n"+gopp_plugin_params.document_link_only+"\n</option>\n<# } #>\n$2";return!!(wp.media&&wp.media.editor&&wp.media.editor.send&&"function"==typeof wp.media.editor.send.attachment&&(b=a("#tmpl-attachment-details"),c=a("#tmpl-attachment-display-settings"),d=a("#tmpl-image-details"),b.length&&c.length&&d.length))&&(e=b.html(),f=e.replace(/(<# } else if \( 'image' === data\.type && data\.sizes \) { #>\s+<img src="{{ data\.size\.url }}" draggable="false" alt="" \/>)(\s+<# } else { #>)/,'$1\n<# } else if ( data.sizes && ( data.sizes.thumbnail || data.sizes.full ) ) { #>\n<img src="{{ ( data.sizes.thumbnail || data.sizes.full ).url }}" draggable="false" alt="" />\n$2'),e!==f&&(e=f,f=e.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting" data-setting="alt")/,"$1 || ( 'application' === data.type && data.sizes )$2"),e!==f&&(e=c.html(),g=e.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting)("| align")/,"$1 || ( 'application' === data.type && data.sizes )$2$3"),e!==g&&(e=g,g=e.replace(/(<# if \( data\.userSettings \) { #>\s+data-user-setting="imgsize"\s+<# } #>>)(\s+<#)/,i),e!==g&&(e=d.html(),h=e.replace(/(<# if \( data\.attachment && window\.imageEdit)( \) { #>)/,"$1 && 'image' === data.type $2"),e!==h&&(b.html(f),c.html(g),d.html(h),wp.media.editor.send.attachment=gopp_plugin.media_editor_send_attachment,!0))))))},gopp_plugin.media_editor_send_attachment=function(a,b){var c,d,e=b.caption;return wp.media.view.settings.captions||delete b.caption,a=wp.media.string.props(a,b),c={id:b.id,post_content:b.description,post_excerpt:e},a.linkUrl&&(c.url=a.linkUrl),a.link&&(c.link_to=a.link),"image"===b.type?(d=wp.media.string.image(a),_.each({align:"align",size:"image-size",alt:"image_alt"},function(b,d){a[d]&&(c[b]=a[d])})):"video"===b.type?d=wp.media.string.video(a,b):"audio"===b.type?d=wp.media.string.audio(a,b):(d=wp.media.string.link(a),c.post_title=a.title,b.sizes&&(b.alt&&(c.alt=b.alt),_.each({align:"align",size:"image-size",alt:"image_alt"},function(b,d){a[d]&&(c[b]=a[d])}))),wp.media.post("send-attachment-to-editor",{nonce:wp.media.view.settings.nonce.sendToEditor,attachment:c,html:d,post_id:wp.media.view.settings.post.id})},gopp_plugin.patch_39630=function(){var b,c,d=a("#tmpl-attachment");return!!d.length&&(b=d.html(),c=b.replace(/(<# } else if \( data\.sizes && )data\.sizes\.medium( \) { #>\s+<img src="{{ )data\.sizes\.medium(\.url }}" class="thumbnail" draggable="false" alt="" \/>\s+<# } else { #>)/,"$1( data.sizes.thumbnail || data.sizes.medium || data.sizes.full )$2( data.sizes.thumbnail || data.sizes.medium || data.sizes.full )$3"),b!==c&&(d.html(c),!0))},a(function(){gopp_plugin_params&&gopp_plugin_params.val&&(gopp_plugin_params.val.is_regen_pdf_preview?gopp_plugin_params.val.current_user_can_cap&&gopp_plugin.regen_pdf_preview():gopp_plugin_params.val.is_upload?(gopp_plugin_params.val.current_user_can_cap&&gopp_plugin.upload(),gopp_plugin.upload_patch(),gopp_plugin.patch_39630()):gopp_plugin_params.val.is_post&&(gopp_plugin.post_patch(),gopp_plugin.patch_39630()))})}(jQuery); -
gs-only-pdf-preview/trunk/languages/gs-only-pdf-preview-fr_FR.po
r1638573 r1677886 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: GS Only PDF Preview 1.0. 6\n"5 "Project-Id-Version: GS Only PDF Preview 1.0.7\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gs-only-pdf-" 7 7 "preview\n" 8 "POT-Creation-Date: 2017-0 4-16 16:03+0100\n"9 "PO-Revision-Date: 2017-0 4-16 16:03+0100\n"8 "POT-Creation-Date: 2017-06-12 22:29+0100\n" 9 "PO-Revision-Date: 2017-06-12 22:29+0100\n" 10 10 "Last-Translator: gitlost <[email protected]>\n" 11 11 "Language-Team: \n" … … 14 14 "Content-Type: text/plain; charset=UTF-8\n" 15 15 "Content-Transfer-Encoding: 8bit\n" 16 "X-Generator: Poedit 1.8.9\n"16 "X-Generator: Poedit 2.0.1\n" 17 17 "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;" 18 18 "_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;" … … 154 154 msgstr "Vous pouvez aller de nouveau ci-dessous si vous voulez." 155 155 156 #: gs-only-pdf-preview.php:349 gs-only-pdf-preview.php:50 1157 #: gs-only-pdf-preview.php: 596156 #: gs-only-pdf-preview.php:349 gs-only-pdf-preview.php:504 157 #: gs-only-pdf-preview.php:600 158 158 msgid "Regenerate PDF Previews" 159 159 msgstr "Régénérer les aperçus de miniature de PDF" … … 163 163 msgstr "Régén. aperçus PDF" 164 164 165 #: gs-only-pdf-preview.php:363 gs-only-pdf-preview.php:46 5166 #: gs-only-pdf-preview.php:66 4165 #: gs-only-pdf-preview.php:363 gs-only-pdf-preview.php:468 166 #: gs-only-pdf-preview.php:668 167 167 msgid "Sorry, you are not allowed to access this page." 168 168 msgstr "" … … 170 170 "page. " 171 171 172 #: gs-only-pdf-preview.php:47 2172 #: gs-only-pdf-preview.php:475 173 173 msgid "GS Only PDF Preview - Regenerate PDF Previews" 174 174 msgstr "GS Only PDF Preview - Régénérer les aperçus de miniature de PDF." 175 175 176 #: gs-only-pdf-preview.php:4 77176 #: gs-only-pdf-preview.php:480 177 177 msgid "" 178 178 "This tool is for regenerating the thumbnail previews of PDFs, but no PDFs " … … 182 182 "fichier PDF n’a été téléchargé, donc il n’a rien à faire." 183 183 184 #: gs-only-pdf-preview.php:48 4184 #: gs-only-pdf-preview.php:487 185 185 msgid "" 186 186 "<strong>Warning: cannot set max execution time!</strong> The maximum time " … … 193 193 "donc éprouver l’écran blanc de mort (WSOD) en essayant ceci." 194 194 195 #: gs-only-pdf-preview.php:49 3195 #: gs-only-pdf-preview.php:496 196 196 msgid "Regenerate the thumbnail previews of PDFs uploaded to your system." 197 197 msgstr "" … … 200 200 201 201 #. translators: %s: formatted number of PDFs found. 202 #: gs-only-pdf-preview.php: 498202 #: gs-only-pdf-preview.php:501 203 203 msgid "<strong>%s</strong> PDF has been found." 204 204 msgid_plural "<strong>%s</strong> PDFs have been found." … … 207 207 208 208 #. translators: %s: formatted number (greater than 10) of PDFs found. 209 #: gs-only-pdf-preview.php:50 6209 #: gs-only-pdf-preview.php:509 210 210 msgid "Regenerating %s PDF previews can take a long time." 211 211 msgstr "" … … 213 213 214 214 #. translators: %s: url to the Media Library page in list mode. 215 #: gs-only-pdf-preview.php:5 18215 #: gs-only-pdf-preview.php:521 216 216 msgid "" 217 217 "Note that you can also regenerate PDF previews in batches or individually " … … 226 226 "<a href=\"%s\">mode de liste de la bibliothèque des médias</a>." 227 227 228 #: gs-only-pdf-preview.php:5 58228 #: gs-only-pdf-preview.php:562 229 229 msgid "Please wait..." 230 230 msgstr "S’il vous plaît attendre..." 231 231 232 #: gs-only-pdf-preview.php:56 2232 #: gs-only-pdf-preview.php:566 233 233 msgid "No items selected!" 234 234 msgstr "Aucun élément sélectionné !" 235 235 236 #: gs-only-pdf-preview.php:56 3236 #: gs-only-pdf-preview.php:567 237 237 msgid "Regenerate Preview ajax action not available!" 238 238 msgstr "" 239 239 "L’action de régénérer l’aperçu n’est pas disponible !" 240 240 241 #: gs-only-pdf-preview.php:5 67241 #: gs-only-pdf-preview.php:571 242 242 msgid "Document Link Only" 243 243 msgstr "Lien de document seulement" 244 244 245 245 #. translators: %s: attachment title 246 #: gs-only-pdf-preview.php:6 49246 #: gs-only-pdf-preview.php:653 247 247 msgid "Regenerate the PDF preview for “%s”" 248 248 msgstr "Régénérer l’aperçu de miniature de PDF pour “%s”" 249 249 250 #: gs-only-pdf-preview.php:65 0250 #: gs-only-pdf-preview.php:654 251 251 msgid "Regenerate Preview" 252 252 msgstr "Régénérer l’aperçu" 253 253 254 #: gs-only-pdf-preview.php:6 69254 #: gs-only-pdf-preview.php:673 255 255 msgid "Invalid nonce." 256 256 msgstr "Nonce invalide." 257 257 258 #: gs-only-pdf-preview.php:67 2258 #: gs-only-pdf-preview.php:676 259 259 msgid "Invalid ID." 260 260 msgstr "Identifiant invalide." 261 261 262 #: gs-only-pdf-preview.php:6 78262 #: gs-only-pdf-preview.php:682 263 263 msgid "Failed to generate the PDF preview." 264 264 msgstr "Échec de générer l’aperçu de miniature de PDF." 265 265 266 #: gs-only-pdf-preview.php:68 3266 #: gs-only-pdf-preview.php:687 267 267 msgid "" 268 268 "Successfully regenerated the PDF preview. It's best to refresh your browser " … … 273 273 "jour correctement." 274 274 275 #: gs-only-pdf-preview.php:68 5275 #: gs-only-pdf-preview.php:689 276 276 msgid "" 277 277 "Successfully regenerated the PDF preview. You will need to refresh your " … … 283 283 #. translators: %1$d: percentage of PDF previews completed; %2$d: completed 284 284 #. count. 285 #: gs-only-pdf-preview.php:71 4285 #: gs-only-pdf-preview.php:718 286 286 msgid "%d%% (%d)" 287 287 msgstr "%d%% (%d)" … … 299 299 msgstr "Pas de Ghostscript." 300 300 301 #: includes/class-gopp-image-editor-gs.php:18 7301 #: includes/class-gopp-image-editor-gs.php:189 302 302 msgid "Image Editor Save Failed" 303 303 msgstr "L’enregistrement de l’éditeur d’images a échoué." 304 304 305 #: includes/class-gopp-image-editor-gs.php:19 2305 #: includes/class-gopp-image-editor-gs.php:194 306 306 msgid "Could not read image size." 307 307 msgstr "Impossible de lire la taille de l’image." 308 308 309 #: includes/class-gopp-image-editor-gs.php:23 0309 #: includes/class-gopp-image-editor-gs.php:232 310 310 msgid "Loading from URL not supported." 311 311 msgstr "Chargement à partir de l’URL non pris en charge." 312 312 313 #: includes/class-gopp-image-editor-gs.php:23 5314 #: includes/class-gopp-image-editor-gs.php:24 1313 #: includes/class-gopp-image-editor-gs.php:237 314 #: includes/class-gopp-image-editor-gs.php:243 315 315 msgid "Unsupported file name." 316 316 msgstr "Nom du fichier non supporté." 317 317 318 #: includes/class-gopp-image-editor-gs.php:25 1318 #: includes/class-gopp-image-editor-gs.php:253 319 319 msgid "File doesn’t exist?" 320 320 msgstr "Le fichier n’existe pas ?" 321 321 322 #: includes/class-gopp-image-editor-gs.php:2 58322 #: includes/class-gopp-image-editor-gs.php:260 323 323 msgid "File is not a PDF." 324 324 msgstr "Le fichier n’est pas un PDF ." 325 325 326 #: includes/class-gopp-image-editor-gs.php:64 2326 #: includes/class-gopp-image-editor-gs.php:647 327 327 msgid "Attempted to set PDF preview resolution to an invalid value." 328 328 msgstr "" … … 330 330 "valeur non valide." 331 331 332 #: includes/class-gopp-image-editor-gs.php: 697332 #: includes/class-gopp-image-editor-gs.php:702 333 333 msgid "Attempted to set PDF preview page to an invalid value." 334 334 msgstr "" … … 336 336 "non valide." 337 337 338 #: includes/class-gopp-image-editor-gs.php:7 16339 #: includes/class-gopp-image-editor-gs.php:7 37340 #: includes/class-gopp-image-editor-gs.php:7 56341 #: includes/class-gopp-image-editor-gs.php:7 69342 #: includes/class-gopp-image-editor-gs.php:78 3343 #: includes/class-gopp-image-editor-gs.php: 796338 #: includes/class-gopp-image-editor-gs.php:721 339 #: includes/class-gopp-image-editor-gs.php:742 340 #: includes/class-gopp-image-editor-gs.php:761 341 #: includes/class-gopp-image-editor-gs.php:774 342 #: includes/class-gopp-image-editor-gs.php:788 343 #: includes/class-gopp-image-editor-gs.php:801 344 344 msgid "Unsupported operation." 345 345 msgstr "Opération non supportée." 346 346 347 #: includes/debug-gopp-image-editor-gs.php:15 347 #: includes/debug-gopp-image-editor-gs.php:12 348 msgid "Exec disabled!" 349 msgstr "Exec désactivé !" 350 351 #: includes/debug-gopp-image-editor-gs.php:18 348 352 msgid "Ghostscript command not found!" 349 353 msgstr "Commande Ghostscript introuvable !" -
gs-only-pdf-preview/trunk/languages/gs-only-pdf-preview.pot
r1638573 r1677886 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: GS Only PDF Preview 1.0. 6\n"5 "Project-Id-Version: GS Only PDF Preview 1.0.7\n" 6 6 "Report-Msgid-Bugs-To: " 7 7 "https://wordpress.org/support/plugin/gs-only-pdf-preview\n" … … 132 132 133 133 #: gs-only-pdf-preview.php:349 gs-only-pdf-preview.php:504 134 #: gs-only-pdf-preview.php: 599134 #: gs-only-pdf-preview.php:600 135 135 msgid "Regenerate PDF Previews" 136 136 msgstr "" … … 141 141 142 142 #: gs-only-pdf-preview.php:363 gs-only-pdf-preview.php:468 143 #: gs-only-pdf-preview.php:66 7143 #: gs-only-pdf-preview.php:668 144 144 msgid "Sorry, you are not allowed to access this page." 145 145 msgstr "" … … 187 187 msgstr "" 188 188 189 #: gs-only-pdf-preview.php:56 1189 #: gs-only-pdf-preview.php:562 190 190 msgid "Please wait..." 191 191 msgstr "" 192 192 193 #: gs-only-pdf-preview.php:56 5193 #: gs-only-pdf-preview.php:566 194 194 msgid "No items selected!" 195 195 msgstr "" 196 196 197 #: gs-only-pdf-preview.php:56 6197 #: gs-only-pdf-preview.php:567 198 198 msgid "Regenerate Preview ajax action not available!" 199 199 msgstr "" 200 200 201 #: gs-only-pdf-preview.php:57 0201 #: gs-only-pdf-preview.php:571 202 202 msgid "Document Link Only" 203 203 msgstr "" 204 204 205 #: gs-only-pdf-preview.php:65 2205 #: gs-only-pdf-preview.php:653 206 206 #. translators: %s: attachment title 207 207 msgid "Regenerate the PDF preview for “%s”" 208 208 msgstr "" 209 209 210 #: gs-only-pdf-preview.php:65 3210 #: gs-only-pdf-preview.php:654 211 211 msgid "Regenerate Preview" 212 212 msgstr "" 213 213 214 #: gs-only-pdf-preview.php:67 2214 #: gs-only-pdf-preview.php:673 215 215 msgid "Invalid nonce." 216 216 msgstr "" 217 217 218 #: gs-only-pdf-preview.php:67 5218 #: gs-only-pdf-preview.php:676 219 219 msgid "Invalid ID." 220 220 msgstr "" 221 221 222 #: gs-only-pdf-preview.php:68 1222 #: gs-only-pdf-preview.php:682 223 223 msgid "Failed to generate the PDF preview." 224 224 msgstr "" 225 225 226 #: gs-only-pdf-preview.php:68 6226 #: gs-only-pdf-preview.php:687 227 227 msgid "" 228 228 "Successfully regenerated the PDF preview. It's best to refresh your browser " … … 230 230 msgstr "" 231 231 232 #: gs-only-pdf-preview.php:68 8232 #: gs-only-pdf-preview.php:689 233 233 msgid "" 234 234 "Successfully regenerated the PDF preview. You will need to refresh your " … … 236 236 msgstr "" 237 237 238 #: gs-only-pdf-preview.php:71 7238 #: gs-only-pdf-preview.php:718 239 239 #. translators: %1$d: percentage of PDF previews completed; %2$d: completed 240 240 #. count. … … 254 254 msgstr "" 255 255 256 #: includes/class-gopp-image-editor-gs.php:18 7256 #: includes/class-gopp-image-editor-gs.php:189 257 257 msgid "Image Editor Save Failed" 258 258 msgstr "" 259 259 260 #: includes/class-gopp-image-editor-gs.php:19 2260 #: includes/class-gopp-image-editor-gs.php:194 261 261 msgid "Could not read image size." 262 262 msgstr "" 263 263 264 #: includes/class-gopp-image-editor-gs.php:23 0264 #: includes/class-gopp-image-editor-gs.php:232 265 265 msgid "Loading from URL not supported." 266 266 msgstr "" 267 267 268 #: includes/class-gopp-image-editor-gs.php:23 5269 #: includes/class-gopp-image-editor-gs.php:24 1268 #: includes/class-gopp-image-editor-gs.php:237 269 #: includes/class-gopp-image-editor-gs.php:243 270 270 msgid "Unsupported file name." 271 271 msgstr "" 272 272 273 #: includes/class-gopp-image-editor-gs.php:25 1273 #: includes/class-gopp-image-editor-gs.php:253 274 274 msgid "File doesn’t exist?" 275 275 msgstr "" 276 276 277 #: includes/class-gopp-image-editor-gs.php:2 58277 #: includes/class-gopp-image-editor-gs.php:260 278 278 msgid "File is not a PDF." 279 279 msgstr "" 280 280 281 #: includes/class-gopp-image-editor-gs.php:64 2281 #: includes/class-gopp-image-editor-gs.php:647 282 282 msgid "Attempted to set PDF preview resolution to an invalid value." 283 283 msgstr "" 284 284 285 #: includes/class-gopp-image-editor-gs.php: 697285 #: includes/class-gopp-image-editor-gs.php:702 286 286 msgid "Attempted to set PDF preview page to an invalid value." 287 287 msgstr "" 288 288 289 #: includes/class-gopp-image-editor-gs.php:7 16290 #: includes/class-gopp-image-editor-gs.php:7 37291 #: includes/class-gopp-image-editor-gs.php:7 56292 #: includes/class-gopp-image-editor-gs.php:7 69293 #: includes/class-gopp-image-editor-gs.php:78 3294 #: includes/class-gopp-image-editor-gs.php: 796289 #: includes/class-gopp-image-editor-gs.php:721 290 #: includes/class-gopp-image-editor-gs.php:742 291 #: includes/class-gopp-image-editor-gs.php:761 292 #: includes/class-gopp-image-editor-gs.php:774 293 #: includes/class-gopp-image-editor-gs.php:788 294 #: includes/class-gopp-image-editor-gs.php:801 295 295 msgid "Unsupported operation." 296 296 msgstr "" 297 297 298 #: includes/debug-gopp-image-editor-gs.php:15 298 #: includes/debug-gopp-image-editor-gs.php:12 299 msgid "Exec disabled!" 300 msgstr "" 301 302 #: includes/debug-gopp-image-editor-gs.php:18 299 303 msgid "Ghostscript command not found!" 300 304 msgstr "" -
gs-only-pdf-preview/trunk/readme.txt
r1638573 r1677886 3 3 Tags: Ghostscript, PDF, PDF Preview, Ghostscript Only 4 4 Requires at least: 4.7.0 5 Tested up to: 4. 7.36 Stable tag: 1.0. 65 Tested up to: 4.8.0 6 Stable tag: 1.0.7 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 12 12 == Description == 13 13 14 The plugin pre-empts the standard WordPress 4.7 PDF preview production process (which uses the PHP extension [`Imagick`](http://php.net/manual/en/book.imagick.php)) to call [Ghostscript](https://ghostscript.com/) directly to produce the preview.14 The plugin pre-empts the standard WordPress 4.7/4.8 PDF preview production process (which uses the PHP extension [`Imagick`](http://php.net/manual/en/book.imagick.php)) to call [Ghostscript](https://ghostscript.com/) directly to produce the preview. 15 15 16 16 This means that only Ghostscript is required on the server. Neither the PHP module `Imagick` nor the server package [`ImageMagick`](https://www.imagemagick.org/script/index.php) is needed or used (though it's fine if they're installed anyway, and if they are they'll be used by WP (unless you override it) to produce the intermediate sizes of the preview). … … 20 20 The plugin was prompted by the `WP_Image_Editor_Imagick_External` demonstration class uploaded to the WP Trac ticket [#39262 Fall back to ImageMagick command line when the pecl imagic is not available on the server](https://core.trac.wordpress.org/ticket/39262) by [Hristo Pandjarov](https://profiles.wordpress.org/hristo-sg), and by the wish to solve the WP Trac ticket [#39216 PDFs with non-opaque alpha channels can result in previews with black backgrounds.](https://core.trac.wordpress.org/ticket/39216), which particularly affects PDFs with CMYK color spaces (common in the print world). 21 21 22 The plugin by-passes (as far as PDF previews are concerned) #39216, and also by-passes the related issue [#39331 unsharpMaskImage in Imagick's thumbnail_image is not compatible with CMYK jpegs.](https://core.trac.wordpress.org/ticket/39331), as the preview jpegs produced directly by Ghostscript use sRGB color spaces.22 The plugin by-passes (as far as PDF previews are concerned) #39216, and also by-passes the related issue [#39331 unsharpMaskImage in Imagick's thumbnail_image is not compatible with CMYK JPEGs.](https://core.trac.wordpress.org/ticket/39331), as the preview JPEGs produced directly by Ghostscript use sRGB color spaces. 23 23 24 24 = Limitations = … … 40 40 = Size = 41 41 42 On jpeg thumbnail size it appears to be comparable (though it depends on the PDF), maybe a bit larger on average. To mitigate this the default jpeg quality for the PDF preview has been lowered to 70 (from 82), which results in some extra "ringing" (speckles around letters) but the previews tested remain very readable. Note that this only affects the "full" PDF thumbnail - the intermediate-sized thumbnails as produced by `Imagick` or `GD` and any other non-PDF images remain at the standard jpegquality of 82. You can use the WP filter [`wp_editor_set_quality`](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/) to override this, for instance to restore the quality to 82 add to your theme's "functions.php":42 On JPEG thumbnail size it appears to be comparable (though it depends on the PDF), maybe a bit larger on average. To mitigate this the default JPEG quality for the PDF preview has been lowered to 70 (from 82), which results in some extra "ringing" (speckles around letters) but the previews tested remain very readable. Note that this only affects the "full" PDF thumbnail - the intermediate-sized thumbnails as produced by `Imagick` or `GD` and any other non-PDF images remain at the standard JPEG quality of 82. You can use the WP filter [`wp_editor_set_quality`](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/) to override this, for instance to restore the quality to 82 add to your theme's "functions.php": 43 43 44 44 function mytheme_wp_editor_set_quality( $quality, $mime_type ) { … … 52 52 = Quality = 53 53 54 Eyeballing based on very limited data, ie anecdotally, the previews seem to be of superior definition with less artifacts (even with the jpegquality reduced to 70), and more faithful to the original colours.54 Eyeballing based on very limited data, ie anecdotally, the previews seem to be of superior definition with less artifacts (even with the JPEG quality reduced to 70), and more faithful to the original colours. 55 55 56 56 = Tool = … … 68 68 A google-cheating schoolboy French translation is supplied. 69 69 70 The plugin runs on WP 4.7.0 to 4. 7.3, and requires Ghostscript to be installed on the server. The plugin should run on PHP 5.2.17 to 7.1, and on both Unix and Windows servers.70 The plugin runs on WP 4.7.0 to 4.8.0, and requires Ghostscript to be installed on the server. The plugin should run on PHP 5.2.17 to 7.1, and on both Unix and Windows servers. 71 71 72 72 The project is on [github](https://github.com/gitlost/gs-only-pdf-preview). … … 139 139 140 140 == Changelog == 141 142 = 1.0.7 (13 Jun 2017) = 143 * Fix regex for patching "Align" select of Attachment Display Settings after core changeset [40640]. 144 * Rejig tests. 145 * WP 4.8.0 compatible. 141 146 142 147 = 1.0.6 (16 Apr 2017) = … … 153 158 * Override get_size() to work if loaded. 154 159 * Enable "Alt Text" on Attachment Details. 155 * WP 4.7.3 compatible 160 * WP 4.7.3 compatible. 156 161 157 162 = 1.0.4 (13 Feb 2017) = … … 169 174 * Patch WP to allow preview image linking in Add Media (#39618). 170 175 * Patch WP to use thumbnail or medium sized thumbnails in Media Library (#39630). 171 * WP 4.7.2 compatible 176 * WP 4.7.2 compatible. 172 177 173 178 = 1.0.1 (20 Jan 2017) = … … 182 187 == Upgrade Notice == 183 188 189 = 1.0.7 = 190 Tested with WordPress 4.8.0, with compatibility fix for patching "Align" select of Attachment Display Settings. 191 184 192 = 1.0.6 = 185 193 Keeps backward-compatibility for linked thumbnails.
Note: See TracChangeset
for help on using the changeset viewer.