Extract image dimensions (height, width) from Base64 String?

N

Neo Geshel

Greetings.

I have managed to stitch together an awesome method of posting text
along with an image to a database, in a way that allows an unlimited
number of previews to ensure that text and image are perfect before
submission. This involves converting any uploaded image to a Base64
String and holding that in a hidden form field until either the post
gets submitted to the database or the image gets replaced with another one.

I have just one question. It is really easy to determine the image’s
dimensions during the initial “preview†(before it is converted to
Base64), but the data naturally gets lost on subsequent previews if the
only thing getting passed along is the Base64 string containing the
image data.

I was wondering if there was some way I could parse the Base64 String to
determine the dimensions of the image, or do I have to take the much
more messy way of including hidden form fields to hold the values?

TIA
...Geshel
--
***********************************************************************
* My reply-to is an automatically monitored spam honeypot. Do not use *
* it unless you want to be blacklisted by SpamCop. Please reply to my *
* first name at my last name dot org. *
***********************************************************************
“Anyone who believes in Intelligent Design (“creationismâ€) is just as
ignorant and ill-educated as someone who believes that the world is
flat, that the Sun circles the Earth or that there really is a tooth
fairy. Darwinism has an overwhelming foundation of evidence that can be
tested and reproduced. Intelligent Design, on the other hand, has no
evidence at all; not one single shred of testable proof. As such,
Intelligent Design is Religious Mythology, and has no right whatsoever
to be in our Science classrooms.†- 99.99+% of Scientists
***********************************************************************
Mignon McLaughlin once said that “A nymphomaniac is a woman [who is] as
obsessed with sex as the average man.†Unfortunately, since true
nymphomaniacs are so rare, this means that it takes an extraordinary
woman to keep up with an ordinary man.
***********************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top