Skip to content

Resize an image to the same size as the original #18

@jbjanot

Description

@jbjanot

Hi ! Thank you for your plugin, it's very useful on daily WordPress developement.

A bug appeared in one of my current projects. When my base image is the same dimensions as the desired resized image, it creates a buggy resulting image.

Example :

My image uploaded in the media library is 300 x 600 pixels.

In my function, I have this code :
wp_get_attachment_image_src($image_id, array(300, 600));

It creates an image that is interpreted as 0x0 in google chrome :
buggy

I don't understand why it resizes the image and creates a new one, as the base image is already at the desired dimensions.
Is there a way to prevent this ?

Any idea about the chrome buggy image dimensions ? I am wondering if it may be a meta-data related problem.

Thank you for your help !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions