By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 2,030 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

Image viewer in PHP?

AaronL
P: 99
Hey everyone,

I want to make an image viewer for the software that I'm developing, it's going to display products but I want it to have a magnifying glass to view up close similar to the image viewer that BigCommerce uses (but not junky looking)? Anyone know where I could start to look for code? Also, can PHP detect the size of an image that is being uploaded and if it's over a certain resolution have it resize the image?

Thanks!
Jan 20 '12 #1
Share this Question
Share on Google+
3 Replies


Dormilich
Expert Mod 5K+
P: 8,639
Also, can PHP detect the size of an image that is being uploaded and if it's over a certain resolution have it resize the image?
if you saved the image somewhere (which will be at least a temporary file) you can get the filesize like any other file (there are a lot of filesystem functions). resizing can be done using the GD library 8and its functions.
Jan 20 '12 #2

AaronL
P: 99
right but is there a way to detect what size the uploaded file is, for example, I want to see if the file is bigger than 1024x768 and if it is THEN resize it to 1024x768 maximum, if the size of the file is below that, then leave it alone...
Jan 21 '12 #3

Dormilich
Expert Mod 5K+
P: 8,639
ah, image dimensions. there is an appropriate function in the GD library as well: getimagesize().
Jan 21 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.