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

  • SEARCH
  • Home
  • 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 7056201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:50:21+00:00 2026-05-28T03:50:21+00:00

Let me explain what I am trying to do, I am building a command

  • 0

Let me explain what I am trying to do, I am building a command line tool with PHP that uses these programs to optimize images for the web…

imagemagick to determine file type and convert non-animated gif’s to png
gifsicle to optimize Animated Gif images
jpegtran to optimize jpg images
pngcrush to optimize png image
pngquant to optimize png images to png8 format
pngout to optimize png images to png8 format

This is a pretty heavy process to be running, luckily it is done very infrequently but I would still like to optimize as much as I can.

Right now to process around 12 images takes roughly 76 seconds. So you can see it is a slow process, imagine 100 images.

I would really like to somehow, mark an image as optimized somehow, so when I am loading a batch of images, the first thing it does is run through ImageMagick to get the exact file type, would be nice if I could somehow embed a message that says this image is already optimized as much as it can be, and then when I am reading images in, if it detects a message it will know to not waste valuable time running that particular image through all the other programs, if this is possible, it could greatly increase speed.

Please help me, I am not used to working with images like this, is this possible even, if it is what is it called and how could I achieve it?

Thanks for any help

  • 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-28T03:50:22+00:00Added an answer on May 28, 2026 at 3:50 am

    If you were to include a flag in the image itself then that would be served to the clients. It would add to the filesize of your images thus negating some of your optimisation.

    Suggestions

    Keep a reference of the status

    Keep a catalog in a file in the same directory – much like the Windows Thumbs.db file.

    Another option would be to keep the record in a database or datastore such as Redis or Memcached.

    Move after processing

    You could move the files to a different directory once they are processed (as @Jordan mentions).

    Change the filename to indicate it is processed

    Another option would be to append an extra “extension” onto the file name for example:

    my_image.processed.jpg
    

    Embedding data in images

    Steganography

    Usually this is used for attempting to hide covert data in an image and it is called Steganography. It is not really suited to this use case however.

    EXIF data

    You could write it into the EXIF data of an image, but this would be JPEG and TIFF only as far as I am aware. There is a PHP library available called PEL for writing and reading EXIF data.

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

Sidebar

Related Questions

First let me explain my goal. I am trying to make an Animation that
let me explain well.. I'm trying to write a program that listen the keys
Quite new to maven here so let me explain first what I am trying
Let me explain: this is path to this folder: > www.my_site.com/images And images are
Alright let me explain my situation first: I am part of an organization that
Let me try to explain my challenge. I'm building a Silverlight app which will
I am trying to make a conditional colorization in Excel 2007. Let me explain
Let me explain what I'm trying to realize: I have a encrypted tar file.
Ok, so let me explain a little of what I am trying to do.
i'm a newbie to web development world. Let me explain what i want. id

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.