Plugin Directory

Changeset 1592102


Ignore:
Timestamp:
02/08/2017 11:04:34 PM (9 years ago)
Author:
gitlost
Message:

v1.0.2

Location:
gs-only-pdf-preview/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • gs-only-pdf-preview/trunk/gs-only-pdf-preview.php

    r1578987 r1592102  
    44 * Plugin URI: https://github.com/gitlost/gs-only-pdf-preview
    55 * Description: Uses Ghostscript directly to generate PDF previews.
    6  * Version: 1.0.1
     6 * Version: 1.0.2
    77 * Author: gitlost
    88 * Author URI: https://profiles.wordpress.org/gitlost
     
    1717
    1818// These need to be synced with "readme.txt".
    19 define( 'GOPP_PLUGIN_VERSION', '1.0.1' ); // Sync also "package.json" and "language/gs-only-pdf-preview.pot".
     19define( 'GOPP_PLUGIN_VERSION', '1.0.2' ); // Sync also "package.json" and "language/gs-only-pdf-preview.pot".
    2020define( 'GOPP_PLUGIN_WP_AT_LEAST_VERSION', '4.7.0' );
    21 define( 'GOPP_PLUGIN_WP_UP_TO_VERSION', '4.7.1' );
     21define( 'GOPP_PLUGIN_WP_UP_TO_VERSION', '4.7.2' );
    2222
    2323define( 'GOPP_REGEN_PDF_PREVIEWS_SLUG', 'gopp-regen-pdf-previews' );
     
    3232    static $per_pdf_secs = 20; // Seconds to allow for regenerating the preview of each PDF in the "Regen. PDF Previews" administraion tool.
    3333    static $min_time_limit = 300; // Minimum seconds to set max execution time to on doing regeneration.
    34     static $poll_interval = 2; // How often to poll for progress info in seconds.
     34    static $poll_interval = 1; // How often to poll for progress info in seconds.
    3535    static $timing_dec_places = 1; // Number of decimal places to show on time (in seconds) taken.
    3636
     
    5555                add_action( 'current_screen', array( __CLASS__, 'current_screen' ) );
    5656                add_action( 'media_row_actions', array( __CLASS__, 'media_row_actions' ), 100, 3 ); // Add after (most) others due to spinner.
     57            } else {
     58                add_filter( 'media_send_to_editor', array( __CLASS__, 'media_send_to_editor' ), 10, 3 );
    5759            }
    5860            add_action( 'wp_ajax_gopp_media_row_action', array( __CLASS__, 'gopp_media_row_action' ) );
     
    331333     */
    332334    static function do_regen_pdf_previews( $ids, $check_mime_type = false, $do_transient = true ) {
     335        static $upload_dir = null, $basedir = null;
    333336
    334337        $cnt = $num_updates = $num_fails = $time = 0;
     
    349352                    $num_fails++;
    350353                } else {
     354                    // Get current metadata if any.
     355                    $old_value = get_metadata( 'post', $id, '_wp_attachment_metadata' );
     356                    if ( $old_value && ( ! is_array( $old_value ) || 1 !== count( $old_value ) ) ) {
     357                        $old_value = null;
     358                    }
     359                    // Remove old intermediate thumbnails if any.
     360                    if ( $old_value && ! empty( $old_value[0]['sizes'] ) && is_array( $old_value[0]['sizes'] ) ) {
     361                        if ( null === $upload_dir ) {
     362                            $upload_dir = wp_get_upload_dir();
     363                            $basedir = $upload_dir['basedir'];
     364                        }
     365                        $dirname = dirname( $file ) . '/';
     366                        foreach ( $old_value[0]['sizes'] as $sizeinfo ) {
     367                            $intermediate_file = $dirname . $sizeinfo['file'];
     368                            @ unlink( path_join( $basedir, $intermediate_file ) );
     369                        }
     370                    }
     371                    // Generate new intermediate thumbnails.
    351372                    $meta = wp_generate_attachment_metadata( $id, $file );
    352373                    if ( ! $meta ) {
     
    354375                    } else {
    355376                        // wp_update_attachment_metadata() returns false if nothing to update so check first.
    356                         $old_value = get_metadata( 'post', $id, '_wp_attachment_metadata' );
    357                         if ( ( $old_value && is_array( $old_value ) && 1 === count( $old_value ) && $old_value[0] === $meta ) || false !== wp_update_attachment_metadata( $id, $meta ) ) {
     377                        if ( ( $old_value && $old_value[0] === $meta ) || false !== wp_update_attachment_metadata( $id, $meta ) ) {
    358378                            $num_updates++;
    359379                        } else {
     
    465485     */
    466486    static function admin_enqueue_scripts( $hook_suffix ) {
    467         if ( self::$hook_suffix === $hook_suffix || 'upload.php' === $hook_suffix ) {
     487        if ( self::$hook_suffix === $hook_suffix || 'upload.php' === $hook_suffix || 'post-new.php' === $hook_suffix || 'post.php' === $hook_suffix ) {
    468488            $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
    469489            $is_regen_pdf_preview = self::$hook_suffix === $hook_suffix;
    470490            $is_upload = 'upload.php' === $hook_suffix;
     491            $is_post = 'post-new.php' === $hook_suffix || 'post.php' === $hook_suffix;
    471492
    472493            wp_enqueue_script( 'gs-only-pdf-preview', plugins_url( "js/gs-only-pdf-preview{$suffix}.js", __FILE__ ), array( 'jquery', 'jquery-migrate' ), GOPP_PLUGIN_VERSION );
     
    478499                    'is_regen_pdf_preview' => $is_regen_pdf_preview,
    479500                    'is_upload' => $is_upload,
     501                    'is_post' => $is_post,
    480502                ),
    481503            );
     
    489511                $params['spinner'] = self::spinner( 5, true /*is_active*/ );
    490512                $params['val']['min_time_limit'] = self::$min_time_limit;
     513            } elseif ( $is_post ) {
     514                $params['document_link_only'] = __( 'Document Link Only', 'gs-only-pdf-preview' );
    491515            }
    492516            $params = apply_filters( 'gopp_plugin_params', $params );
     
    530554        if ( 'gopp_regen_pdf_previews' === $doaction && current_user_can( self::$cap ) ) {
    531555            // Note nonce has already been checked in "wp-admin/upload.php".
    532             // But $post_ids hasn't (and triggers a PHP Warning if nothing selected in "wp-admin/upload.php:168" as of WP 4.7.1).
     556            // But $post_ids hasn't (and triggers a PHP Warning if nothing selected in "wp-admin/upload.php:168" as of WP 4.7.2).
    533557            $ids = $post_ids && is_array( $post_ids ) ? array_map( 'intval', $post_ids ) : array();
    534558
     
    648672        wp_send_json( $ret );
    649673    }
     674
     675    /**
     676     * Called on 'media_send_to_editor' filter.
     677     */
     678    static function media_send_to_editor( $html, $id, $attachment ) {
     679        // Using the fact that 'post_title' is only set for non-image/audio/video links. See wp.media.editor.send.attachment in "wp-includes/js/media-editor.js" (line 1018).
     680        if ( ! empty( $attachment['image-size'] ) && isset( $attachment['post_title'] ) && false === strpos( $html, '<img' ) ) {
     681            $url = empty( $attachment['url'] ) ? '' : $attachment['url'];
     682            $rel = ( strpos( $url, 'attachment_id') || get_attachment_link( $id ) == $url );
     683
     684            // Based on wp_ajax_send_attachment_to_editor() in "wp-admin/includes/ajax-actions.php".
     685            $align = isset( $attachment['align'] ) ? $attachment['align'] : 'none';
     686            $size = $attachment['image-size'];
     687            $alt = isset( $attachment['image_alt'] ) ? $attachment['image_alt'] : '';
     688
     689            // No whitespace-only captions.
     690            $caption = isset( $attachment['post_excerpt'] ) ? $attachment['post_excerpt'] : '';
     691            if ( '' === trim( $caption ) ) {
     692                $caption = '';
     693            }
     694
     695            $title = ''; // We no longer insert title tags into <img> tags, as they are redundant.
     696            $html = get_image_send_to_editor( $id, $caption, $title, $align, $url, $rel, $size, $alt );
     697        }
     698        return $html;
     699    }
    650700}
    651701
  • gs-only-pdf-preview/trunk/includes/class-gopp-image-editor-gs.php

    r1578987 r1592102  
    162162        }
    163163
    164         if ( ! $filename ) {
    165             $filename = $this->generate_filename( null, null, $extension );
    166         }
     164        if ( ! $filename || ! ( $dirname = dirname( $filename ) ) ) {
     165            return new WP_Error( 'image_save_error', __( 'Unsupported destination.', 'gs-only-pdf-preview' ), $filename );
     166        }
     167
     168        // Make sure not to overwrite existing JPEG with same name.
     169        $filename = $dirname . '/' . wp_unique_filename( $dirname, wp_basename( $filename ) );
    167170
    168171        if ( ! ( $cmd = self::gs_cmd( $this->get_gs_args( $filename ) ) ) ) {
     
    183186        }
    184187
    185         // For form's sake, transmogrify into the JPEG file.
     188        // Transmogrify into the JPEG file.
    186189        $this->file = $filename;
    187190        $this->mime_type = $mime_type;
  • gs-only-pdf-preview/trunk/js/gs-only-pdf-preview.js

    r1578349 r1592102  
    33 */
    44/*jslint ass: true, nomen: true, plusplus: true, regexp: true, vars: true, white: true, indent: 4 */
    5 /*global jQuery, wp, commonL10n, gopp_plugin_params, console */
     5/*global jQuery, _, wp, ajaxurl, gopp_plugin_params */
    66/*exported gopp_plugin */
    77
     
    124124    };
    125125
     126    /**
     127     * Patches templates and wp.media.editor.send.attachment to allow PDF thumbnail insertion (see #39618).
     128     * Also addresses #39630 by using either thumbnail or medium sized thumbnails in Media Library, favouring thumbnail size.
     129     */
     130    gopp_plugin.post = function () {
     131        var $tmpl_attachment_details, $tmpl_attachment_display_settings, $tmpl_image_details, html_before,
     132            html_attachment_details,
     133            attachment_details_re = /(<# } else if \( 'image' === data\.type && data\.sizes \) { #>[\s]+<img src="{{ data\.size\.url }}" draggable="false" alt="" \/>[\s]+)(<# } else { #>)/,
     134            attachment_details_with = '$1\n<# } else if ( data.sizes && data.sizes.thumbnail ) { #>\n<img src="{{ data.sizes.thumbnail.url }}" draggable="false" alt="" />$2',
     135            html_attachment_display_settings,
     136            attachment_display_settings_re = /(<# if \( data\.userSettings \) { #>[\s]+data-user-setting="imgsize"[\s]+<# } #>>)([\s]+<#)/,
     137            attachment_display_settings_with = '$1\n<# if ( \'application\' === data.type ) { #>\n<option value="">\n' + gopp_plugin_params.document_link_only + '\n</option>\n<# } #>\n$2',
     138            html_image_details,
     139            image_details_re = /(<# if \( data\.attachment && window\.imageEdit)( \) { #>)/,
     140            image_details_with = '$1 && \'image\' === data.type $2';
     141
     142        if ( wp.media && wp.media.editor && wp.media.editor.send && 'function' === typeof( wp.media.editor.send.attachment ) ) {
     143            $tmpl_attachment_details = $( '#tmpl-attachment-details' );
     144            $tmpl_attachment_display_settings = $( '#tmpl-attachment-display-settings' );
     145            $tmpl_image_details = $( '#tmpl-image-details' );
     146            if ( $tmpl_attachment_details.length && $tmpl_attachment_display_settings.length && $tmpl_image_details.length ) {
     147
     148                // All or nothing - if any replacements fail, bail.
     149
     150                // Uses PDF thumbnail in Attachment Details (instead of icon).
     151                html_before = $tmpl_attachment_details.html();
     152                html_attachment_details = html_before.replace( attachment_details_re, attachment_details_with );
     153                if ( html_before === html_attachment_details ) {
     154                    return false;
     155                }
     156
     157                // #39618 Adds "Document Link Only" option to Size select of Attachment Details.
     158                html_before = $tmpl_attachment_display_settings.html();
     159                html_attachment_display_settings = html_before.replace( attachment_display_settings_re, attachment_display_settings_with );
     160                if ( html_before === html_attachment_display_settings ) {
     161                    return false;
     162                }
     163
     164                // #39618 Don't allow editing/replacement of image if it's a PDF thumbnail in Image Details edit.
     165                html_before = $tmpl_image_details.html();
     166                html_image_details = html_before.replace( image_details_re, image_details_with );
     167                if ( html_before === html_image_details ) {
     168                    return false;
     169                }
     170
     171                // #39630 Use either thumbnail or medium sized thumbnails in Media Library.
     172                if ( false === gopp_plugin.patch_39630() ) {
     173                    return false;
     174                }
     175
     176                $tmpl_attachment_details.html( html_attachment_details );
     177                $tmpl_attachment_display_settings.html( html_attachment_display_settings );
     178                $tmpl_image_details.html( html_image_details );
     179
     180                // Replace with version to set image options for PDFs.
     181                wp.media.editor.send.attachment = gopp_plugin.media_editor_send_attachment;
     182
     183                return true;
     184            }
     185        }
     186        return false;
     187    };
     188
     189    /**
     190     * Version of wp.media.editor.send.attachment() ("wp-includes/js/media-editor.js") hacked to set image options for PDFs.
     191     */
     192    gopp_plugin.media_editor_send_attachment = function( props, attachment ) {
     193        var caption = attachment.caption,
     194            options, html;
     195
     196        // If captions are disabled, clear the caption.
     197        if ( ! wp.media.view.settings.captions ) {
     198            delete attachment.caption;
     199        }
     200
     201        props = wp.media.string.props( props, attachment );
     202
     203        options = {
     204            id:           attachment.id,
     205            post_content: attachment.description,
     206            post_excerpt: caption
     207        };
     208
     209        if ( props.linkUrl ) {
     210            options.url = props.linkUrl;
     211        }
     212
     213        if ( 'image' === attachment.type ) {
     214            html = wp.media.string.image( props );
     215
     216            _.each({
     217                align: 'align',
     218                size:  'image-size',
     219                alt:   'image_alt'
     220            }, function( option, prop ) {
     221                if ( props[ prop ] )
     222                    options[ option ] = props[ prop ];
     223            });
     224        } else if ( 'video' === attachment.type ) {
     225            html = wp.media.string.video( props, attachment );
     226        } else if ( 'audio' === attachment.type ) {
     227            html = wp.media.string.audio( props, attachment );
     228        } else {
     229            html = wp.media.string.link( props );
     230            options.post_title = props.title;
     231            // Begin hack.
     232            if ( 'application' === attachment.type && 'pdf' === attachment.subtype ) {
     233                _.each({
     234                    align: 'align',
     235                    size:  'image-size'
     236                }, function( option, prop ) {
     237                    if ( props[ prop ] )
     238                        options[ option ] = props[ prop ];
     239                });
     240            }
     241            // End hack.
     242        }
     243
     244        return wp.media.post( 'send-attachment-to-editor', {
     245            nonce:      wp.media.view.settings.nonce.sendToEditor,
     246            attachment: options,
     247            html:       html,
     248            post_id:    wp.media.view.settings.post.id
     249        });
     250    };
     251
     252    /**
     253     * Patches 'tmpl-attachment in "wp-includes/media-templates.php" to use either thumbnail or medium sized thumbnails in Media Library, favouring thumbnail size.
     254     */
     255    gopp_plugin.patch_39630 = function () {
     256        var $tmpl_attachment = $( '#tmpl-attachment' ), html_before, html_attachment,
     257            attachment_re = /(<# } else if \( data\.sizes && )data\.sizes\.medium( \) { #>[\s]+<img src="{{ )data\.sizes\.medium(\.url }}" class="thumbnail" draggable="false" alt="" \/>[\s]+<# } else { #>)/,
     258            attachment_with = '$1( data.sizes.thumbnail || data.sizes.medium )$2( data.sizes.thumbnail || data.sizes.medium )$3';
     259
     260        if ( $tmpl_attachment.length ) {
     261
     262            html_before = $tmpl_attachment.html();
     263            html_attachment = html_before.replace( attachment_re, attachment_with );
     264            if ( html_before === html_attachment ) {
     265                return false;
     266            }
     267            $tmpl_attachment.html( html_attachment );
     268            return true;
     269        }
     270        return false;
     271    };
     272
     273
    126274    // jQuery ready.
    127275    $( function () {
     
    131279            } else if ( gopp_plugin_params.val.is_upload ) {
    132280                gopp_plugin.upload();
     281                gopp_plugin.patch_39630();
     282            } else if ( gopp_plugin_params.val.is_post ) {
     283                gopp_plugin.post();
    133284            }
    134285        }
  • gs-only-pdf-preview/trunk/js/gs-only-pdf-preview.min.js

    r1582214 r1592102  
    1 /*! gs-only-pdf-preview 1.0.1 2017-01-25 */
    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){var e=a(b.target),f=e.parents(".row-actions").first(),g=e.next();return a(".gopp_response",f.parent()).remove(),g.addClass("is-active"),a.post({url:ajaxurl,data:{action:"gopp_media_row_action",id:c,nonce:d},dataType:"json",error:function(b,c,d){var e;g.removeClass("is-active"),e='<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+" ("+d+")</p></div>",f.after(a(e))},success:function(b){g.removeClass("is-active"),a(".gopp_response",f.parent()).remove(),b?(b.error?f.after(a('<div class="notice error gopp_response"><p>'+b.error+"</p></div>")):b.msg&&f.after(a('<div class="notice updated gopp_response"><p>'+b.msg+"</p></div>")),b.img&&a(".has-media-icon .media-icon",f.parent()).html(b.img)):f.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}),!1},gopp_plugin.upload=function(){a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){var c,d;"gopp_regen_pdf_previews"===a(this).val()&&(c=a(b.target),d=a.makeArray(a('#the-list input[name="media[]"]:checked').map(function(){return this.value})),d.length?(a(".spinner",c.parent()).remove(),a(gopp_plugin_params.spinner).insertAfter(c)):(b.preventDefault(),a(".gopp_none",c.parent()).remove(),a(gopp_plugin_params.no_items_selected_msg).insertAfter(c).fadeOut(1e3,function(){a(this).remove()})))})})},a(function(){gopp_plugin_params&&gopp_plugin_params.val&&(gopp_plugin_params.val.is_regen_pdf_preview?gopp_plugin.regen_pdf_preview():gopp_plugin_params.val.is_upload&&gopp_plugin.upload())})}(jQuery);
     1/*! gs-only-pdf-preview 1.0.2 2017-02-08 */
     2var 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){var e=a(b.target),f=e.parents(".row-actions").first(),g=e.next();return a(".gopp_response",f.parent()).remove(),g.addClass("is-active"),a.post({url:ajaxurl,data:{action:"gopp_media_row_action",id:c,nonce:d},dataType:"json",error:function(b,c,d){var e;g.removeClass("is-active"),e='<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+" ("+d+")</p></div>",f.after(a(e))},success:function(b){g.removeClass("is-active"),a(".gopp_response",f.parent()).remove(),b?(b.error?f.after(a('<div class="notice error gopp_response"><p>'+b.error+"</p></div>")):b.msg&&f.after(a('<div class="notice updated gopp_response"><p>'+b.msg+"</p></div>")),b.img&&a(".has-media-icon .media-icon",f.parent()).html(b.img)):f.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}),!1},gopp_plugin.upload=function(){a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){var c,d;"gopp_regen_pdf_previews"===a(this).val()&&(c=a(b.target),d=a.makeArray(a('#the-list input[name="media[]"]:checked').map(function(){return this.value})),d.length?(a(".spinner",c.parent()).remove(),a(gopp_plugin_params.spinner).insertAfter(c)):(b.preventDefault(),a(".gopp_none",c.parent()).remove(),a(gopp_plugin_params.no_items_selected_msg).insertAfter(c).fadeOut(1e3,function(){a(this).remove()})))})})},gopp_plugin.post=function(){var b,c,d,e,f,g,h,i=/(<# } else if \( 'image' === data\.type && data\.sizes \) { #>[\s]+<img src="{{ data\.size\.url }}" draggable="false" alt="" \/>[\s]+)(<# } else { #>)/,j='$1\n<# } else if ( data.sizes && data.sizes.thumbnail ) { #>\n<img src="{{ data.sizes.thumbnail.url }}" draggable="false" alt="" />$2',k=/(<# if \( data\.userSettings \) { #>[\s]+data-user-setting="imgsize"[\s]+<# } #>>)([\s]+<#)/,l="$1\n<# if ( 'application' === data.type ) { #>\n<option value=\"\">\n"+gopp_plugin_params.document_link_only+"\n</option>\n<# } #>\n$2",m=/(<# if \( data\.attachment && window\.imageEdit)( \) { #>)/,n="$1 && 'image' === data.type $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(i,j),e===f?!1:(e=c.html(),g=e.replace(k,l),e===g?!1:(e=d.html(),h=e.replace(m,n),e===h?!1:!1===gopp_plugin.patch_39630()?!1:(b.html(f),c.html(g),d.html(h),wp.media.editor.send.attachment=gopp_plugin.media_editor_send_attachment,!0)))):!1},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),"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,"application"===b.type&&"pdf"===b.subtype&&_.each({align:"align",size:"image-size"},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"),e=/(<# } else if \( data\.sizes && )data\.sizes\.medium( \) { #>[\s]+<img src="{{ )data\.sizes\.medium(\.url }}" class="thumbnail" draggable="false" alt="" \/>[\s]+<# } else { #>)/,f="$1( data.sizes.thumbnail || data.sizes.medium )$2( data.sizes.thumbnail || data.sizes.medium )$3";return d.length?(b=d.html(),c=b.replace(e,f),b===c?!1:(d.html(c),!0)):!1},a(function(){gopp_plugin_params&&gopp_plugin_params.val&&(gopp_plugin_params.val.is_regen_pdf_preview?gopp_plugin.regen_pdf_preview():gopp_plugin_params.val.is_upload?(gopp_plugin.upload(),gopp_plugin.patch_39630()):gopp_plugin_params.val.is_post&&gopp_plugin.post())})}(jQuery);
  • gs-only-pdf-preview/trunk/languages/gs-only-pdf-preview-fr_FR.po

    r1582214 r1592102  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: GS Only PDF Preview 1.0.1\n"
     5"Project-Id-Version: GS Only PDF Preview 1.0.2\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gs-only-pdf-"
    77"preview\n"
    8 "POT-Creation-Date: 2017-01-25 15:50+0000\n"
    9 "PO-Revision-Date: 2017-01-25 15:51+0000\n"
     8"POT-Creation-Date: 2017-02-08 21:11+0000\n"
     9"PO-Revision-Date: 2017-02-08 21:11+0000\n"
    1010"Last-Translator: gitlost <[email protected]>\n"
    1111"Language-Team: \n"
     
    2525
    2626#. translators: %s: url to admin plugins page.
    27 #: gs-only-pdf-preview.php:91
     27#: gs-only-pdf-preview.php:93
    2828msgid ""
    2929"The plugin \"GS Only PDF Preview\" cannot be activated as it relies on the "
     
    3939
    4040#. translators: %s: url to admin plugins page.
    41 #: gs-only-pdf-preview.php:97
     41#: gs-only-pdf-preview.php:99
    4242msgid ""
    4343"The plugin \"GS Only PDF Preview\" cannot be activated as it relies on the "
     
    5151
    5252#. translators: %s: url to admin plugins page.
    53 #: gs-only-pdf-preview.php:110
     53#: gs-only-pdf-preview.php:112
    5454msgid ""
    5555"The plugin \"GS Only PDF Preview\" cannot be activated as it relies on the "
     
    6565
    6666#. translators: %s: url to admin plugins page.
    67 #: gs-only-pdf-preview.php:122
     67#: gs-only-pdf-preview.php:124
    6868msgid ""
    6969"The plugin \"GS Only PDF Preview\" cannot be activated as it is incompatible "
     
    7878#. translators: %1$s: lowest compatible WordPress version; %2$s: user's current
    7979#. WordPress version; %3$s: url to admin plugins page.
    80 #: gs-only-pdf-preview.php:138
     80#: gs-only-pdf-preview.php:140
    8181msgid ""
    8282"The plugin \"GS Only PDF Preview\" cannot be activated as it requires "
     
    9090#. translators: %1$s: highest WordPress version tested; %2$s: user's current
    9191#. WordPress version.
    92 #: gs-only-pdf-preview.php:151
     92#: gs-only-pdf-preview.php:153
    9393msgid ""
    9494"<strong>Warning: untested!</strong> The plugin \"GS Only PDF Preview\" has "
     
    9999"versions de WordPress justqu&rsquo;à %1$s. Vous avez WordPress version %2$s."
    100100
    101 #: gs-only-pdf-preview.php:163
     101#: gs-only-pdf-preview.php:165
    102102msgid ""
    103103"<strong>Warning: no Ghostscript!</strong> The plugin \"GS Only PDF Preview\" "
     
    108108"déterminer l&rsquo;emplacement du serveur de votre exécutable Ghostscript."
    109109
    110 #: gs-only-pdf-preview.php:216
     110#: gs-only-pdf-preview.php:218
    111111msgid "Invalid arguments!"
    112112msgstr "Paramètres invalides&nbsp;!"
    113113
    114 #: gs-only-pdf-preview.php:221
     114#: gs-only-pdf-preview.php:223
    115115msgid "No PDFs found!"
    116116msgstr "Aucun fichier PDF trouvé&nbsp;!"
     
    118118#. translators: %1$s: formatted number of PDF previews regenerated; %2$s:
    119119#. formatted number of seconds to one decimal place it took.
    120 #: gs-only-pdf-preview.php:227
     120#: gs-only-pdf-preview.php:229
    121121msgid "%1$s PDF preview regenerated in %2$s seconds."
    122122msgid_plural "%1$s PDF previews regenerated in %2$s seconds."
     
    125125
    126126#. translators: %s: formatted number of non-PDFs ignored.
    127 #: gs-only-pdf-preview.php:233
     127#: gs-only-pdf-preview.php:235
    128128msgid "%s non-PDF ignored."
    129129msgid_plural "%s non-PDFs ignored."
     
    131131msgstr[1] "%s non PDFs ignorés."
    132132
    133 #: gs-only-pdf-preview.php:238
     133#: gs-only-pdf-preview.php:240
    134134msgid "Nothing updated!"
    135135msgstr "Rien mis à jour&nbsp;!"
    136136
    137137#. translators: %s: formatted number of non-PDFs ignored.
    138 #: gs-only-pdf-preview.php:242
     138#: gs-only-pdf-preview.php:244
    139139msgid "Nothing updateable! %s non-PDF ignored."
    140140msgid_plural "Nothing updateable! %s non-PDFs ignored."
     
    143143
    144144#. translators: %s: formatted number of PDF previews that failed to regenerate.
    145 #: gs-only-pdf-preview.php:249
     145#: gs-only-pdf-preview.php:251
    146146msgid "%s PDF preview not regenerated."
    147147msgid_plural "%s PDF previews not regenerated."
     
    149149msgstr[1] "%s aperçus de miniature de PDF non régénérés."
    150150
    151 #: gs-only-pdf-preview.php:255
     151#: gs-only-pdf-preview.php:257
    152152msgid "You can go again below if you want."
    153153msgstr "Vous pouvez aller de nouveau ci-dessous si vous voulez."
    154154
    155 #: gs-only-pdf-preview.php:293 gs-only-pdf-preview.php:429
    156 #: gs-only-pdf-preview.php:519
     155#: gs-only-pdf-preview.php:295 gs-only-pdf-preview.php:449
     156#: gs-only-pdf-preview.php:543
    157157msgid "Regenerate PDF Previews"
    158158msgstr "Régénérer les aperçus de miniature de PDF"
    159159
    160 #: gs-only-pdf-preview.php:293
     160#: gs-only-pdf-preview.php:295
    161161msgid "Regen. PDF Previews"
    162162msgstr "Régén. aperçus PDF"
    163163
    164 #: gs-only-pdf-preview.php:307 gs-only-pdf-preview.php:394
    165 #: gs-only-pdf-preview.php:590
     164#: gs-only-pdf-preview.php:309 gs-only-pdf-preview.php:414
     165#: gs-only-pdf-preview.php:614
    166166msgid "Sorry, you are not allowed to access this page."
    167167msgstr ""
     
    169169"page. "
    170170
    171 #: gs-only-pdf-preview.php:400
     171#: gs-only-pdf-preview.php:420
    172172msgid "GS Only PDF Preview - Regenerate PDF Previews"
    173173msgstr "GS Only PDF Preview -  Régénérer les aperçus de miniature de PDF."
    174174
    175 #: gs-only-pdf-preview.php:405
     175#: gs-only-pdf-preview.php:425
    176176msgid ""
    177177"This tool is for regenerating the thumbnail previews of PDFs, but no PDFs "
     
    181181"fichier PDF n&rsquo;a été téléchargé, donc il n&rsquo;a rien à faire."
    182182
    183 #: gs-only-pdf-preview.php:412
     183#: gs-only-pdf-preview.php:432
    184184msgid ""
    185185"<strong>Warning: cannot set max execution time!</strong> The maximum time "
     
    192192"donc éprouver l&rsquo;écran blanc de mort (WSOD) en essayant ceci."
    193193
    194 #: gs-only-pdf-preview.php:421
     194#: gs-only-pdf-preview.php:441
    195195msgid "Regenerate the thumbnail previews of PDFs uploaded to your system."
    196196msgstr ""
     
    199199
    200200#. translators: %s: formatted number of PDFs found.
    201 #: gs-only-pdf-preview.php:426
     201#: gs-only-pdf-preview.php:446
    202202msgid "<strong>%s</strong> PDF has been found."
    203203msgid_plural "<strong>%s</strong> PDFs have been found."
     
    206206
    207207#. translators: %s: formatted number (greater than 10) of PDFs found.
    208 #: gs-only-pdf-preview.php:434
     208#: gs-only-pdf-preview.php:454
    209209msgid "Regenerating %s PDF previews can take a long time."
    210210msgstr ""
     
    212212
    213213#. translators: %s: url to the Media Library page in list mode.
    214 #: gs-only-pdf-preview.php:446
     214#: gs-only-pdf-preview.php:466
    215215msgid ""
    216216"Note that you can also regenerate PDF previews in batches or individually "
     
    225225"<a href=\"%s\">mode de liste de la bibliothèque des médias</a>."
    226226
    227 #: gs-only-pdf-preview.php:483
     227#: gs-only-pdf-preview.php:505
    228228msgid "Please wait..."
    229229msgstr "S&rsquo;il vous plaît attendre..."
    230230
    231 #: gs-only-pdf-preview.php:487
     231#: gs-only-pdf-preview.php:509
    232232msgid "No items selected!"
    233233msgstr "Aucun élément sélectionné&nbsp;!"
    234234
    235 #: gs-only-pdf-preview.php:488
     235#: gs-only-pdf-preview.php:510
    236236msgid "Regenerate Preview ajax action not available!"
    237237msgstr ""
    238238"L&rsquo;action de régénérer l&rsquo;aperçu n&rsquo;est pas disponible&nbsp;!"
    239239
     240#: gs-only-pdf-preview.php:514
     241msgid "Document Link Only"
     242msgstr "Lien de document seulement"
     243
    240244#. translators: %s: attachment title
    241 #: gs-only-pdf-preview.php:574
     245#: gs-only-pdf-preview.php:598
    242246msgid "Regenerate the PDF preview for &#8220;%s&#8221;"
    243247msgstr "Régénérer l&rsquo;aperçu de miniature de PDF pour &#8220;%s&#8221;"
    244248
    245 #: gs-only-pdf-preview.php:575
     249#: gs-only-pdf-preview.php:599
    246250msgid "Regenerate&nbsp;Preview"
    247251msgstr "Régénérer&nbsp;l&rsquo;aperçu"
    248252
    249 #: gs-only-pdf-preview.php:595
     253#: gs-only-pdf-preview.php:619
    250254msgid "Invalid nonce."
    251255msgstr "Nonce invalide."
    252256
    253 #: gs-only-pdf-preview.php:598
     257#: gs-only-pdf-preview.php:622
    254258msgid "Invalid ID."
    255259msgstr "Identifiant invalide."
    256260
    257 #: gs-only-pdf-preview.php:604
     261#: gs-only-pdf-preview.php:628
    258262msgid "Failed to generate the PDF preview."
    259263msgstr "Échec de générer l&rsquo;aperçu de miniature de PDF."
    260264
    261 #: gs-only-pdf-preview.php:609
     265#: gs-only-pdf-preview.php:633
    262266msgid ""
    263267"Successfully regenerated the PDF preview. It's best to refresh your browser "
     
    268272"jour correctement."
    269273
    270 #: gs-only-pdf-preview.php:611
     274#: gs-only-pdf-preview.php:635
    271275msgid ""
    272276"Successfully regenerated the PDF preview. You will need to refresh your "
     
    278282#. translators: %1$d: percentage of PDF previews completed; %2$d: completed
    279283#. count.
    280 #: gs-only-pdf-preview.php:640
     284#: gs-only-pdf-preview.php:664
    281285msgid "%d%% (%d)"
    282286msgstr "%d%% (%d)"
     
    286290msgstr "Type MIME non supporté."
    287291
    288 #: includes/class-gopp-image-editor-gs.php:169
     292#: includes/class-gopp-image-editor-gs.php:165
     293msgid "Unsupported destination."
     294msgstr "Destination non supportée."
     295
     296#: includes/class-gopp-image-editor-gs.php:172
    289297msgid "No Ghostscript."
    290298msgstr "Pas de Ghostscript."
    291299
    292 #: includes/class-gopp-image-editor-gs.php:175
     300#: includes/class-gopp-image-editor-gs.php:178
    293301msgid "Image Editor Save Failed"
    294302msgstr "L&rsquo;enregistrement de l&rsquo;éditeur d&rsquo;images a échoué."
    295303
    296 #: includes/class-gopp-image-editor-gs.php:182
     304#: includes/class-gopp-image-editor-gs.php:185
    297305msgid "Could not read image size."
    298306msgstr "Impossible de lire la taille de l&rsquo;image."
    299307
    300 #: includes/class-gopp-image-editor-gs.php:220
     308#: includes/class-gopp-image-editor-gs.php:223
    301309msgid "Loading from URL not supported."
    302310msgstr "Chargement à partir de l&rsquo;URL non pris en charge."
    303311
    304 #: includes/class-gopp-image-editor-gs.php:225
    305 #: includes/class-gopp-image-editor-gs.php:230
     312#: includes/class-gopp-image-editor-gs.php:228
     313#: includes/class-gopp-image-editor-gs.php:233
    306314msgid "Unsupported file name."
    307315msgstr "Nom du fichier non supporté."
    308316
    309 #: includes/class-gopp-image-editor-gs.php:240
     317#: includes/class-gopp-image-editor-gs.php:243
    310318msgid "File doesn&#8217;t exist?"
    311319msgstr "Le fichier n&rsquo;existe pas&nbsp;?"
    312320
    313 #: includes/class-gopp-image-editor-gs.php:247
     321#: includes/class-gopp-image-editor-gs.php:250
    314322msgid "File is not a PDF."
    315323msgstr "Le fichier n&rsquo;est pas un PDF ."
    316324
    317 #: includes/class-gopp-image-editor-gs.php:629
     325#: includes/class-gopp-image-editor-gs.php:632
    318326msgid "Attempted to set PDF preview resolution to an invalid value."
    319327msgstr ""
     
    321329"valeur non valide."
    322330
    323 #: includes/class-gopp-image-editor-gs.php:684
     331#: includes/class-gopp-image-editor-gs.php:687
    324332msgid "Attempted to set PDF preview page to an invalid value."
    325333msgstr ""
     
    327335"non valide."
    328336
    329 #: includes/class-gopp-image-editor-gs.php:703
    330 #: includes/class-gopp-image-editor-gs.php:724
    331 #: includes/class-gopp-image-editor-gs.php:743
    332 #: includes/class-gopp-image-editor-gs.php:756
    333 #: includes/class-gopp-image-editor-gs.php:770
    334 #: includes/class-gopp-image-editor-gs.php:783
     337#: includes/class-gopp-image-editor-gs.php:706
     338#: includes/class-gopp-image-editor-gs.php:727
     339#: includes/class-gopp-image-editor-gs.php:746
     340#: includes/class-gopp-image-editor-gs.php:759
     341#: includes/class-gopp-image-editor-gs.php:773
     342#: includes/class-gopp-image-editor-gs.php:786
    335343msgid "Unsupported operation."
    336344msgstr "Opération non supportée."
  • gs-only-pdf-preview/trunk/languages/gs-only-pdf-preview.pot

    r1578987 r1592102  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: GS Only PDF Preview 1.0.1\n"
     5"Project-Id-Version: GS Only PDF Preview 1.0.2\n"
    66"Report-Msgid-Bugs-To: "
    77"https://wordpress.org/support/plugin/gs-only-pdf-preview\n"
     
    2626"X-Textdomain-Support: yes\n"
    2727
    28 #: gs-only-pdf-preview.php:91
     28#: gs-only-pdf-preview.php:93
    2929#. translators: %s: url to admin plugins page.
    3030msgid ""
     
    3535msgstr ""
    3636
    37 #: gs-only-pdf-preview.php:97
     37#: gs-only-pdf-preview.php:99
    3838#. translators: %s: url to admin plugins page.
    3939msgid ""
     
    4343msgstr ""
    4444
    45 #: gs-only-pdf-preview.php:110
     45#: gs-only-pdf-preview.php:112
    4646#. translators: %s: url to admin plugins page.
    4747msgid ""
     
    5353msgstr ""
    5454
    55 #: gs-only-pdf-preview.php:122
     55#: gs-only-pdf-preview.php:124
    5656#. translators: %s: url to admin plugins page.
    5757msgid ""
     
    6262msgstr ""
    6363
    64 #: gs-only-pdf-preview.php:138
     64#: gs-only-pdf-preview.php:140
    6565#. translators: %1$s: lowest compatible WordPress version; %2$s: user's current
    6666#. WordPress version; %3$s: url to admin plugins page.
     
    7171msgstr ""
    7272
    73 #: gs-only-pdf-preview.php:151
     73#: gs-only-pdf-preview.php:153
    7474#. translators: %1$s: highest WordPress version tested; %2$s: user's current
    7575#. WordPress version.
     
    7979msgstr ""
    8080
    81 #: gs-only-pdf-preview.php:163
     81#: gs-only-pdf-preview.php:165
    8282msgid ""
    8383"<strong>Warning: no Ghostscript!</strong> The plugin \"GS Only PDF "
     
    8686msgstr ""
    8787
    88 #: gs-only-pdf-preview.php:216
     88#: gs-only-pdf-preview.php:218
    8989msgid "Invalid arguments!"
    9090msgstr ""
    9191
    92 #: gs-only-pdf-preview.php:221
     92#: gs-only-pdf-preview.php:223
    9393msgid "No PDFs found!"
    9494msgstr ""
    9595
    96 #: gs-only-pdf-preview.php:227
     96#: gs-only-pdf-preview.php:229
    9797#. translators: %1$s: formatted number of PDF previews regenerated; %2$s:
    9898#. formatted number of seconds to one decimal place it took.
     
    102102msgstr[1] ""
    103103
    104 #: gs-only-pdf-preview.php:233
     104#: gs-only-pdf-preview.php:235
    105105#. translators: %s: formatted number of non-PDFs ignored.
    106106msgid "%s non-PDF ignored."
     
    109109msgstr[1] ""
    110110
    111 #: gs-only-pdf-preview.php:238
     111#: gs-only-pdf-preview.php:240
    112112msgid "Nothing updated!"
    113113msgstr ""
    114114
    115 #: gs-only-pdf-preview.php:242
     115#: gs-only-pdf-preview.php:244
    116116#. translators: %s: formatted number of non-PDFs ignored.
    117117msgid "Nothing updateable! %s non-PDF ignored."
     
    120120msgstr[1] ""
    121121
    122 #: gs-only-pdf-preview.php:249
     122#: gs-only-pdf-preview.php:251
    123123#. translators: %s: formatted number of PDF previews that failed to regenerate.
    124124msgid "%s PDF preview not regenerated."
     
    127127msgstr[1] ""
    128128
    129 #: gs-only-pdf-preview.php:255
     129#: gs-only-pdf-preview.php:257
    130130msgid "You can go again below if you want."
    131131msgstr ""
    132132
    133 #: gs-only-pdf-preview.php:293 gs-only-pdf-preview.php:429
    134 #: gs-only-pdf-preview.php:519
     133#: gs-only-pdf-preview.php:295 gs-only-pdf-preview.php:449
     134#: gs-only-pdf-preview.php:543
    135135msgid "Regenerate PDF Previews"
    136136msgstr ""
    137137
    138 #: gs-only-pdf-preview.php:293
     138#: gs-only-pdf-preview.php:295
    139139msgid "Regen. PDF Previews"
    140140msgstr ""
    141141
    142 #: gs-only-pdf-preview.php:307 gs-only-pdf-preview.php:394
    143 #: gs-only-pdf-preview.php:590
     142#: gs-only-pdf-preview.php:309 gs-only-pdf-preview.php:414
     143#: gs-only-pdf-preview.php:614
    144144msgid "Sorry, you are not allowed to access this page."
    145145msgstr ""
    146146
    147 #: gs-only-pdf-preview.php:400
     147#: gs-only-pdf-preview.php:420
    148148msgid "GS Only PDF Preview - Regenerate PDF Previews"
    149149msgstr ""
    150150
    151 #: gs-only-pdf-preview.php:405
     151#: gs-only-pdf-preview.php:425
    152152msgid ""
    153153"This tool is for regenerating the thumbnail previews of PDFs, but no PDFs "
     
    155155msgstr ""
    156156
    157 #: gs-only-pdf-preview.php:412
     157#: gs-only-pdf-preview.php:432
    158158msgid ""
    159159"<strong>Warning: cannot set max execution time!</strong> The maximum time "
     
    162162msgstr ""
    163163
    164 #: gs-only-pdf-preview.php:421
     164#: gs-only-pdf-preview.php:441
    165165msgid "Regenerate the thumbnail previews of PDFs uploaded to your system."
    166166msgstr ""
    167167
    168 #: gs-only-pdf-preview.php:426
     168#: gs-only-pdf-preview.php:446
    169169#. translators: %s: formatted number of PDFs found.
    170170msgid "<strong>%s</strong> PDF has been found."
     
    173173msgstr[1] ""
    174174
    175 #: gs-only-pdf-preview.php:434
     175#: gs-only-pdf-preview.php:454
    176176#. translators: %s: formatted number (greater than 10) of PDFs found.
    177177msgid "Regenerating %s PDF previews can take a long time."
    178178msgstr ""
    179179
    180 #: gs-only-pdf-preview.php:446
     180#: gs-only-pdf-preview.php:466
    181181#. translators: %s: url to the Media Library page in list mode.
    182182msgid ""
     
    187187msgstr ""
    188188
    189 #: gs-only-pdf-preview.php:483
     189#: gs-only-pdf-preview.php:505
    190190msgid "Please wait..."
    191191msgstr ""
    192192
    193 #: gs-only-pdf-preview.php:487
     193#: gs-only-pdf-preview.php:509
    194194msgid "No items selected!"
    195195msgstr ""
    196196
    197 #: gs-only-pdf-preview.php:488
     197#: gs-only-pdf-preview.php:510
    198198msgid "Regenerate Preview ajax action not available!"
    199199msgstr ""
    200200
    201 #: gs-only-pdf-preview.php:574
     201#: gs-only-pdf-preview.php:514
     202msgid "Document Link Only"
     203msgstr ""
     204
     205#: gs-only-pdf-preview.php:598
    202206#. translators: %s: attachment title
    203207msgid "Regenerate the PDF preview for &#8220;%s&#8221;"
    204208msgstr ""
    205209
    206 #: gs-only-pdf-preview.php:575
     210#: gs-only-pdf-preview.php:599
    207211msgid "Regenerate&nbsp;Preview"
    208212msgstr ""
    209213
    210 #: gs-only-pdf-preview.php:595
     214#: gs-only-pdf-preview.php:619
    211215msgid "Invalid nonce."
    212216msgstr ""
    213217
    214 #: gs-only-pdf-preview.php:598
     218#: gs-only-pdf-preview.php:622
    215219msgid "Invalid ID."
    216220msgstr ""
    217221
    218 #: gs-only-pdf-preview.php:604
     222#: gs-only-pdf-preview.php:628
    219223msgid "Failed to generate the PDF preview."
    220224msgstr ""
    221225
    222 #: gs-only-pdf-preview.php:609
     226#: gs-only-pdf-preview.php:633
    223227msgid ""
    224228"Successfully regenerated the PDF preview. It's best to refresh your browser "
     
    226230msgstr ""
    227231
    228 #: gs-only-pdf-preview.php:611
     232#: gs-only-pdf-preview.php:635
    229233msgid ""
    230234"Successfully regenerated the PDF preview. You will need to refresh your "
     
    232236msgstr ""
    233237
    234 #: gs-only-pdf-preview.php:640
     238#: gs-only-pdf-preview.php:664
    235239#. translators: %1$d: percentage of PDF previews completed; %2$d: completed
    236240#. count.
     
    242246msgstr ""
    243247
    244 #: includes/class-gopp-image-editor-gs.php:169
     248#: includes/class-gopp-image-editor-gs.php:165
     249msgid "Unsupported destination."
     250msgstr ""
     251
     252#: includes/class-gopp-image-editor-gs.php:172
    245253msgid "No Ghostscript."
    246254msgstr ""
    247255
    248 #: includes/class-gopp-image-editor-gs.php:175
     256#: includes/class-gopp-image-editor-gs.php:178
    249257msgid "Image Editor Save Failed"
    250258msgstr ""
    251259
    252 #: includes/class-gopp-image-editor-gs.php:182
     260#: includes/class-gopp-image-editor-gs.php:185
    253261msgid "Could not read image size."
    254262msgstr ""
    255263
    256 #: includes/class-gopp-image-editor-gs.php:220
     264#: includes/class-gopp-image-editor-gs.php:223
    257265msgid "Loading from URL not supported."
    258266msgstr ""
    259267
    260 #: includes/class-gopp-image-editor-gs.php:225
    261 #: includes/class-gopp-image-editor-gs.php:230
     268#: includes/class-gopp-image-editor-gs.php:228
     269#: includes/class-gopp-image-editor-gs.php:233
    262270msgid "Unsupported file name."
    263271msgstr ""
    264272
    265 #: includes/class-gopp-image-editor-gs.php:240
     273#: includes/class-gopp-image-editor-gs.php:243
    266274msgid "File doesn&#8217;t exist?"
    267275msgstr ""
    268276
    269 #: includes/class-gopp-image-editor-gs.php:247
     277#: includes/class-gopp-image-editor-gs.php:250
    270278msgid "File is not a PDF."
    271279msgstr ""
    272280
    273 #: includes/class-gopp-image-editor-gs.php:629
     281#: includes/class-gopp-image-editor-gs.php:632
    274282msgid "Attempted to set PDF preview resolution to an invalid value."
    275283msgstr ""
    276284
    277 #: includes/class-gopp-image-editor-gs.php:684
     285#: includes/class-gopp-image-editor-gs.php:687
    278286msgid "Attempted to set PDF preview page to an invalid value."
    279287msgstr ""
    280288
    281 #: includes/class-gopp-image-editor-gs.php:703
    282 #: includes/class-gopp-image-editor-gs.php:724
    283 #: includes/class-gopp-image-editor-gs.php:743
    284 #: includes/class-gopp-image-editor-gs.php:756
    285 #: includes/class-gopp-image-editor-gs.php:770
    286 #: includes/class-gopp-image-editor-gs.php:783
     289#: includes/class-gopp-image-editor-gs.php:706
     290#: includes/class-gopp-image-editor-gs.php:727
     291#: includes/class-gopp-image-editor-gs.php:746
     292#: includes/class-gopp-image-editor-gs.php:759
     293#: includes/class-gopp-image-editor-gs.php:773
     294#: includes/class-gopp-image-editor-gs.php:786
    287295msgid "Unsupported operation."
    288296msgstr ""
  • gs-only-pdf-preview/trunk/readme.txt

    r1578987 r1592102  
    33Tags: Ghostscript, PDF, PDF Preview, Ghostscript Only
    44Requires at least: 4.7.0
    5 Tested up to: 4.7.1
    6 Stable tag: 1.0.1
     5Tested up to: 4.7.2
     6Stable tag: 1.0.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5050= Tool =
    5151
    52 A basic administration tool to regenerate (or generate, if they previously didn't have a preview) the previews of all PDFs uploaded to the system is included. Note that if you have a lot of PDFs you may experience the White Screen Of Death (WSOD) if the tool exceeds the [maximum execution time](http://php.net/manual/en/info.configuration.php#ini.max-execution-time) allowed. Note also that as the filenames of the previews don't (normally) change, you will probably have to refresh your browser to see the updated thumbnails.
     52A basic administration tool to regenerate (or generate, if they previously didn't have a preview) the previews of all PDFs uploaded to the system is included (any previously generated intermediate preview thumbnails will be removed if their dimensions differ). Note that if you have a lot of PDFs you may experience the White Screen Of Death (WSOD) if the tool exceeds the [maximum execution time](http://php.net/manual/en/info.configuration.php#ini.max-execution-time) allowed. Note also that as the filenames of the previews don't (normally) change, you will probably have to refresh your browser to see the updated thumbnails.
    5353
    5454As workarounds for the possible WSOD issue above, and as facilities in themselves, a "Regenerate PDF Previews" bulk action is added to the list mode of the Media Library, and a "Regenerate Preview" row action is added to each PDF entry in the list. So previews can be regenerated in batches or individually instead.
     55
     56= Patches =
     57
     58As a bonus version 1.0.2 patches WordPress to allow linking to the preview image in "Add Media" when editing a post ([#39618 Insert PDF Thumbnail into Editor](https://core.trac.wordpress.org/ticket/39618)). Also patches [#39630 PDF Thumbnails in Media Library Don't Fall Back to Full Size](https://core.trac.wordpress.org/ticket/39630).
    5559
    5660= And =
     
    5862A google-cheating schoolboy French translation is supplied.
    5963
    60 The plugin runs on WP 4.7.0 and 4.7.1, 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 systems.
     64The plugin runs on WP 4.7.0 to 4.7.2, 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.
    6165
    6266The project is on [github](https://github.com/gitlost/gs-only-pdf-preview).
     
    8084* `gopp_editor_set_resolution` sets the resolution of the PDF preview.
    8185* `gopp_editor_set_page` sets the page to render for the PDF preview.
    82 * `gopp_image_gs_cmd_path` short-circuits the determination of the path of the Ghostscript executable on your system.
     86* `gopp_image_gs_cmd_path` short-circuits the determination of the path of the Ghostscript executable on your server.
    8387
    8488The `gopp_editor_set_resolution` filter is an analogue of the standard [`wp_editor_set_quality`](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/) filter mentioned above, and allows one to override the default resolution of 128 DPI used for the PDF preview. For instance, in your theme's "functions.php":
     
    103107    add_filter( 'gopp_image_gs_cmd_path', 'mytheme_gopp_image_gs_cmd_path', 10, 2 );
    104108
    105 The filter can also be used just for performance reasons, especially on Windows systems to save searching the registry and directories.
     109The filter can also be used just for performance reasons, especially on Windows servers to save searching the registry and directories.
    106110
    107111Note that the value of `gs_cmd_path` is cached as a transient by the plugin for performance reasons, with a lifetime of one day. You can clear it by de-activating and re-activating the plugin, or by manually calling the `clear` method of the Ghostscript Image Editor:
     
    1221265. Regenerate PDF Previews bulk action in list mode of Media Library.
    1231276. Regenerate Preview row action in list mode of Media Library.
     1287. Link to preview image in "Add Media".
    124129
    125130== Changelog ==
     131
     132= 1.0.2 (8 Feb 2017) =
     133* Don't overwrite existing JPEGs with same name as preview.
     134* Remove existing preview intermediates when regenerating.
     135* Patch WP to allow preview image linking in Add Media (#39618).
     136* Patch WP to use thumbnail or medium sized thumbnails in Media Library (#39630).
     137* WP 4.7.2 compatible
    126138
    127139= 1.0.1 (20 Jan 2017) =
     
    136148== Upgrade Notice ==
    137149
     150= 1.0.2 =
     151Doesn't overwrite existing JPEGs with same name as preview. Removes existing preview thumbnails on regeneration.
     152
    138153= 1.0.1 =
    139154Tweeks.
Note: See TracChangeset for help on using the changeset viewer.