Is it possible to get the width and height of an image during or right after it gets uploaded to a server but "before" it gets viewed in a browser etc
I need to write the filename, width, and height of uploaded photos into a database.
Get image height and width during/after upload
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Get image height and width during/after upload
You will need to run a script on receipt of the image to your server input folder that is launched by new data arriving. This has nothing to do with Imagemagick other than to get the dimension. You need to check your server tools for a notifier of new data to some folder and then launch a script to call Imagemagick to get the dimensions.
Re: Get image height and width during/after upload
JavaScript may be able to get the information before upload but I am not a JavaScript user.
You can get the information in php with getimagesize() but only when the image is on the server. This can be part of your upload script and save data to the database.
You can get the information in php with getimagesize() but only when the image is on the server. This can be part of your upload script and save data to the database.