Page 1 of 1
Get image height and width during/after upload
Posted: 2016-03-26T17:11:21-07:00
by RKwasi
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.
Re: Get image height and width during/after upload
Posted: 2016-03-26T17:37:22-07:00
by fmw42
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
Posted: 2016-03-27T02:12:42-07:00
by Bonzo
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.