Changeset 3086915
- Timestamp:
- 05/15/2024 08:02:40 AM (22 months ago)
- Location:
- mpl-publisher/trunk
- Files:
-
- 4 edited
-
libs/EpubPublisher.php (modified) (1 diff)
-
libs/PublisherBase.php (modified) (4 diffs)
-
mpl-publisher.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mpl-publisher/trunk/libs/EpubPublisher.php
r3001142 r3086915 97 97 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"; 98 98 99 $content_start = 100 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" 101 . $doctype 99 $content_start = $doctype 102 100 . "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" 103 101 . "<head>" -
mpl-publisher/trunk/libs/PublisherBase.php
r3083237 r3086915 700 700 foreach ($content->find('img') as $img) 701 701 { 702 // "remove" will remove the image from the content 702 703 if ($images_load == 'remove') 703 704 { … … 709 710 $file_id = "image_" . time() . '_' . rand(); 710 711 712 // Always: Make sure alt is not empty 711 713 if ( ! $img->alt) $img->alt = $file_id; 712 714 713 // Remove the "-{width}x{height}." part from the image src to get original image715 // Always: Remove the "-{width}x{height}." part from the image src to get original image 714 716 $img->src = preg_replace('/-\d+x\d+\./', '.', $img->src); 715 717 716 // Convert relative image URLs to absolute718 // Always: Convert relative image URLs to absolute 717 719 $img->src = WP_Http::make_absolute_url($img->src, get_bloginfo('url')); 718 720 719 // PremiumPublisher will override insert as it's remote content but easier to handle721 // Override: PremiumPublisher will override "insert" with "default" (load from original URL) 720 722 if ($publisher instanceof PremiumPublisher and $images_load == 'insert') 721 723 { … … 723 725 } 724 726 725 // If there isnothing to do, continue727 // Handling: "default": If images are loaded from original and nothing to do, continue 726 728 if ($images_load == 'default') continue; 727 729 … … 735 737 } 736 738 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" 742 740 // Fixes https://wordpress.org/support/topic/could-not-load-image-when-exporting-docx/ 743 741 if ($publisher instanceof WordPublisher) $images_load = 'embed'; 744 742 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 749 755 if ($images_load == 'insert') 750 756 { -
mpl-publisher/trunk/mpl-publisher.php
r3083237 r3086915 4 4 * Plugin URI: https://wordpress.mpl-publisher.com/ 5 5 * 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. 26 * Version: 2.14.3 7 7 * Author: Ferran Figueredo 8 8 * Author URI: https://ferranfigueredo.com -
mpl-publisher/trunk/readme.txt
r3083237 r3086915 6 6 Tested up to: 6.5 7 7 Requires PHP: 7.4 8 Stable tag: 2.14. 28 Stable tag: 2.14.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 127 127 == Changelog == 128 128 129 = 2.14.3 = 130 - Only resize images to 640px if "embed" option is selected 131 129 132 = 2.14.2 = 130 133 - Fix "Invalid parameters passed." on Word documents
Note: See TracChangeset
for help on using the changeset viewer.