• Hello, firstly to thank You for providing this versatile plugin.

    Among many similar plugin, the Simple images sizes, aside features, seems most suitable, with a large code base, for the modification i need to accustom. Task is to enable re-genereting thumbnails of images located in their directories(copied from the actual website) hosted on the external cdn server.

    After examining the plugin i’ve found it’s processes within simple-image-sizes-master/classes/Admin/ , where the “Main.php” contains functions i’ve mostly managed to modify to have the external files as the urls in place of local, but the processing was failing as the urls were sent to ‘wp-includes/class-wp-image-editor-imagick.php’ class function ‘write_image’ where standard php ‘file_put_contents’ can not work during HTTP headers limitations.

    I went further and have modified the ‘image_make_intermediate_size’ function that is actually calling the mentioned functions, by recreating the $file object path, as following: “

        $upload_dir   = wp_upload_dir();
    $image_path = str_replace( $upload_dir[ 'baseurl' ], $upload_dir[ 'basedir' ], $file );
    $file = $image_path;

    $resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] )

    while $file source was modified earlier as “

        $metadata = [];


    $file = wp_get_attachment_image_url( $attachment_id );

    Now, after try-out testing, with applied modifications as specified, there are no errors in server log, but the files, thumbnails, are not being re-generated within the local server, standard uploads directory.

    Can you please take on brief assessment and suggest if this might need additional modifications?

    Thank you, regards

    • This topic was modified 5 months, 1 week ago by n381.
  • You must be logged in to reply to this topic.