Gallery images increase in file size and lower quality

I am having an issue with the images in a gallery.

The file I am uploading is:
1600x1067
72x72
305 KB
.jpg

When I download the image from the gallery I get this:

800x600
96x96
549 KB
.jpg

And downloading from the lightbox:

1024x683
96x96
783 KB
.jpg

So I have about half the resolution and significantly worse quality, but over twice the file size.

Any idea what is going on?

Edit:

I used this snippet to force the lightbox to use full size images:

add_filter( 'wp_get_attachment_image_src', function( $image, $attachment_id, $size ) {
  // Target only lightbox image size
  if ( is_singular( 'hp_listing' ) && $size === 'large' ) {
    $full = wp_get_attachment_image_src( $attachment_id, 'full' );
    if ( $full ) {
      return $full;
    }
  }
  return $image;
}, 10, 3 );

This worked to give me the original file, which is better quality and has a lower file size. But I still have the issue with the image in the gallery (bigger file size, lower resolution)

Hi,

Thanks for the request and details. Please note that it is the WordPress core image library that makes these changes, while HivePress uses WordPress core functions to upload images, and WordPress does all the cropping and resizing. For automatic optimize images, you can use the LiteSpeed plugin How to Speed up a Directory or Marketplace Website Built with HivePress | HivePress Blog

I hope it helps

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.