Jump to content


calculating filesize of imagecreatetruecolor() images?

  • Please log in to reply
No replies to this topic

#1 michaellunsford

  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 13 April 2006 - 02:25 PM

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.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users