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.076 seconds

Real time saver and great Component Builder tool ! I have been developing with J-Cook Pro Component Builder for several months now and can say with all honesty that this product/service is second to none. The product is feature rich and is being improved and added to all the time. Do yourself a favor if you need to build a Joomla! Component then you can do no wrong in trying the product. You will save on time and effort while being able to deliver your project on time. J-Cook pro does the hard work for you you then have the freedom to fully customise the end result for your own needs. 

One word: Awesome.
Edwardcox (JED)
         

Get Started