Jump to content

calculating filesize of imagecreatetruecolor() images?


michaellunsford

Recommended Posts

I want to save some small avatar type images to a database. I can reduce them into oblivion, but I like the resolution and compression around 64k (which also happens to be the limit I've set in mysql). Is there a way to guesstimate the file-size of an image before attempting to save it to the database?

example: the user is going to upload a file. php will be reducing it to about 640x480 resolution (if it is larger than that) -- but some complex graphics will inevitably be over the 64k limit. So, when that is the case, I might choose to increase the jpg compression.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.