my $image = GD::Image->new($thumb->{content});
my ($width, $height) = $image->getBounds;
my $image = GD::Image->new($thumb->{content});
my ($width, $height) = $image->getBounds;
my $curr_max = max $width, $height, 1;
my $factor = $curr_max <= $max_dim ? 1 : $curr_max / $max_dim;
my $new_width = int($width / $factor + 0.5);
my $curr_max = max $width, $height, 1;
my $factor = $curr_max <= $max_dim ? 1 : $curr_max / $max_dim;
my $new_width = int($width / $factor + 0.5);
return (t8("No file uploaded yet")) if !$content;
my $info = Image::Info::image_info(\$content);
if (!$info || $info->{error} || !$info->{file_media_type} || !$supported_mime_types{ $info->{file_media_type} }) {
return (t8("No file uploaded yet")) if !$content;
my $info = Image::Info::image_info(\$content);
if (!$info || $info->{error} || !$info->{file_media_type} || !$supported_mime_types{ $info->{file_media_type} }) {