Plugin Directory

Changeset 3086915


Ignore:
Timestamp:
05/15/2024 08:02:40 AM (22 months ago)
Author:
ferranfg
Message:

Release 2.14.3

Location:
mpl-publisher/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • mpl-publisher/trunk/libs/EpubPublisher.php

    r3001142 r3086915  
    9797            "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
    9898
    99         $content_start =
    100         "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
    101         . $doctype
     99        $content_start = $doctype
    102100        . "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"
    103101        . "<head>"
  • mpl-publisher/trunk/libs/PublisherBase.php

    r3083237 r3086915  
    700700        foreach ($content->find('img') as $img)
    701701        {
     702            // "remove" will remove the image from the content
    702703            if ($images_load == 'remove')
    703704            {
     
    709710            $file_id = "image_" . time() . '_' . rand();
    710711
     712            // Always: Make sure alt is not empty
    711713            if ( ! $img->alt) $img->alt = $file_id;
    712714
    713             // Remove the "-{width}x{height}." part from the image src to get original image
     715            // Always: Remove the "-{width}x{height}." part from the image src to get original image
    714716            $img->src = preg_replace('/-\d+x\d+\./', '.', $img->src);
    715717
    716             // Convert relative image URLs to absolute
     718            // Always: Convert relative image URLs to absolute
    717719            $img->src = WP_Http::make_absolute_url($img->src, get_bloginfo('url'));
    718720
    719             // PremiumPublisher will override insert as it's remote content but easier to handle
     721            // Override: PremiumPublisher will override "insert" with "default" (load from original URL)
    720722            if ($publisher instanceof PremiumPublisher and $images_load == 'insert')
    721723            {
     
    723725            }
    724726
    725             // If there is nothing to do, continue
     727            // Handling: "default": If images are loaded from original and nothing to do, continue
    726728            if ($images_load == 'default') continue;
    727729
     
    735737            }
    736738
    737             if ($image->width() > 500) $image->resize(500, null, function ($constraint)
    738             {
    739                 $constraint->aspectRatio();
    740             });
    741 
     739            // Override: If not "default" WordPublisher will override always with "embed"
    742740            // Fixes https://wordpress.org/support/topic/could-not-load-image-when-exporting-docx/
    743741            if ($publisher instanceof WordPublisher) $images_load = 'embed';
    744742
    745             // Embed will update original image src
    746             if ($images_load == 'embed') $img->src = $image->encode('data-url');
    747 
    748             // Add will update original image src + add file into the ouput
     743            // Handling: "embed" will resize and update original image src
     744            if ($images_load == 'embed')
     745            {
     746                if ($image->width() > 640) $image->resize(640, null, function ($constraint)
     747                {
     748                    $constraint->aspectRatio();
     749                });
     750
     751                $img->src = $image->encode('data-url');
     752            }
     753
     754            // Handling: "insert" will update original image src + add file into the ouput
    749755            if ($images_load == 'insert')
    750756            {
  • mpl-publisher/trunk/mpl-publisher.php

    r3083237 r3086915  
    44 * Plugin URI: https://wordpress.mpl-publisher.com/
    55 * Description: MPL-Publisher 📚 creates an ebook, print-ready PDF book, EPUB for KDP, or Audiobook MP3 directly from your WordPress posts.
    6  * Version: 2.14.2
     6 * Version: 2.14.3
    77 * Author: Ferran Figueredo
    88 * Author URI: https://ferranfigueredo.com
  • mpl-publisher/trunk/readme.txt

    r3083237 r3086915  
    66Tested up to: 6.5
    77Requires PHP: 7.4
    8 Stable tag: 2.14.2
     8Stable tag: 2.14.3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    127127== Changelog ==
    128128
     129= 2.14.3 =
     130- Only resize images to 640px if "embed" option is selected
     131
    129132= 2.14.2 =
    130133- Fix "Invalid parameters passed." on Word documents
Note: See TracChangeset for help on using the changeset viewer.