• Resolved halcyon1234

    (@halcyon1234)


    Love the plugin so far. I would like to know if it can do two things. I need all the thumbnails of a certain type (let’s say Large) to be an exact aspect ratio: 16:9. I also need them to be an exact dimension– let’s say 160px wide and 90px high. Many of the images I get aren’t exactly 16:9. Some are too tall, or too wide, or they are 16:9 but too high and wide. So when I upload them, I PTE them.

    1) Is it possible to pick a default background color, other than Transparent? I have to keep selected Black #000000 over and over.

    2) Is it possible to do this enmasse? Select a bunch of images from Media, and crop to a specific aspect ration, adding black bars as needed, to a maximum dimension (kind of like mass thumbnail regenerate).

    Thanks

    https://wordpress.org/plugins/post-thumbnail-editor/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author sewpafly

    (@sewpafly)

    To get all your images to 16:9 with the same size you need to create your own thumbnail with add_image_size("16X9", 160, 90, true);. From here on out whenever you request your “16X9” image it is pretty much guaranteed to have the correct size (and aspect ratio).

    (2) I currently have not implemented any batch processing tool, but I can see how that might be useful. I will look into hooking into the thumbnail regenerate plugin.

    (1) This sounds like a good idea for an option, but currently you have to fiddle with some of my code. Depending on if you use gd or imagemagick (enabling debug and looking at the logs after using PTE will tell you which engine you are using) you would modify pte/php/class-pte-image-editor-{gd_or_imagick}.php.

    For GD change line 52 to:

    $color = imagecolorallocatealpha( $img, 0, 0, 0, 0 );

    For imagemagick change line 58 to:

    $img->newImage( $dst_w, $dst_h, isset( $color ) ? $color : 'black' );

    Also change line 61 to be:

    $img->setImageOpacity( 1.0 );

    Plugin Author sewpafly

    (@sewpafly)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Mass automatic black bars’ is closed to new replies.