Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Check for image resolution 19 Apr 2012 17:28 #2063

  • tr4ding
  • tr4ding's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 42
  • Thank you received: 0
Hy everybody and thank you in advance for your great support!!!

I'd like to check not only for extension and size of an image, but also for resolution.....

Looking around I've seen that this code returns width and height of jpg:
$img = @imagecreatefromjpeg('./1.jpg');
$x = ImageSX($img);
$y = ImageSY($img);

How could I implement this solution (presumely in classes/upload.php) in order to check for specific resolutions? (In my case are 640*480 and 800*600).

I hope not boring you.

Thank you!

Please Log in or Create an account to join the conversation.

Re: Check for image resolution 19 Apr 2012 19:45 #2064

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
To do this :

To know the size of the navigator window (not the resolution), you should send the values (x,y) in an url parameter. (You get first these size trough javascript).

Then, you receive them and treat them in order to adjust your thumb sizes.

- If you define predefined fixed sizes (better), you can create cache thumbs.
- If you resize the image to any sizes, you should'nt recreate cache files and directly output the resized image.

Hope it helps.

EDIT : You can store these navigator sizes in session and resend the values throuht AJAX (invisible), anytime that the user resize its window ;-)
Coding is now a piece of cake
The following user(s) said Thank You: tr4ding

Please Log in or Create an account to join the conversation.

Last edit: by admin.
  • Page:
  • 1
Time to create page: 0.117 seconds

For starters it's just so easy to design an app in a way that I'm used to i.e. database first then views followed by customization. The fork system is pure brilliance from a developer standpoint as I can override things and still add and update my projects with minimal effort! Truly amazing to be able to build components in Joomla using incremental refinement without having to do everything by hand. Thanks for the great tool! I am so much more productive now than ever and I can't imagine building components any other way!!!!
Dave (Forum)

Get Started