Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7528375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:21:45+00:00 2026-05-30T04:21:45+00:00

Normally when an image comes into my site I save it as jpg using

  • 0

Normally when an image comes into my site I save it as jpg using an image library I wrote with the default quality of 80%. Now when I need to do some other operation on it (like cropping it, or even just resizing it) the image will be opened as jpg, processed, then saved back. However, if it has been compressed before I don’t want to compress it again or else every time I need to do an operation the quality will fall.

Is there a way that I can detect how much the image has already been compressed before (in comparison to a png version of it I guess) using tools in the standard GD php libraries? I know that tools which detect where an image has been Photoshopped do so by comparing relative amounts of compression so I would think it is possible to detect the amount of compression but does anyone know how I would go about doing this calculation? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:21:47+00:00Added an answer on May 30, 2026 at 4:21 am

    You cannot get quality value from JPG. Moreover, the quality value is encoder dependent. It is not a standard or anything like this. Some programs have only (low, medium, high), in some 20 might be better than 90.

    Secondly, JPG simply will lose quality in each cosnequent encoding, even if you save it as best quality every time. Sad truth of life 🙂 The only operations that do not worse the quality are flips and rotations (and crops, if they are aligned to JPEG block size).

    Rule of the thumb: Encode it every time at the same quality value. Example: If you save it once at let’s say 60, then there is no gain if you save it at 80 next time. Just bigger file size.

    Also, try to reduce the number of such re-encodings and perform each manipulation on the original , if you have enough storage available.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have image intensive listviews that I need to GC, normally it would be
In css you may normally set both a background-image, and a background-color, and the
Normally, you center images with display: block; margin: auto , but if the image
I want to open a GIF image from the python console in Linux. Normally
What is the easiest way to duplicate an image variable in PHP. Normally you
I have a background image with a parenthesis in the filename: <DIV style=BACKGROUND: url('http://site.com/image(8).png');></DIV>
Normally if you were loading an image from a URL you would do the
Normally in html we will use Model.field.url(:thumb) inside image tag, How to do it
Normally i'm putting only important link inside my sitemap which right now they are
I normally avoid using Adobe products for web development because they create pages that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.