Skip to content

Conversation

mwehr
Copy link

@mwehr mwehr commented Sep 26, 2023

Hi,

This fixes division by zero in case a new thumbnail needs to be generated.

kind regards,
Mario

@aolley
Copy link
Collaborator

aolley commented Sep 26, 2023

This will reduce performance when viewing galleries as it always loads the image metadata.

It'd be preferable to simply load this data when its actually needed to generate a new thumbnail as opposed to always.

@mwehr
Copy link
Author

mwehr commented Sep 27, 2023

We have the problem that in case if a new thumbnail is needed, and "Show extended image info" is "No" the width and height are 0.
So the division in the get_image_resized() #320 throws a division by zero.

Another option would be to leave the "if" clause and additionally check for an empty "thumbnail"

if (is_null($thumbnail) ||  $loadextrainfo) {
    $imageinfo = $this->storedfile->get_imageinfo();
    $this->height = $imageinfo['height'];
    $this->width = $imageinfo['width'];
}

What do you think ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants