Sizing JPEG Images (OpenInsight 32-bit Specific)
At 20 FEB 2003 12:47:02PM Richard Guise wrote:
Eric the Emu and others have documented simple routines to find size of JPEG image from the file "header". However, I have come across some JPEGs which produce wrong result (albeit to correct aspect ratio) - such as from Casio camera.
Photo processing software gets it right. Hence it seems there's some alternative dimension units used in JPEG files.
Can anyone tell me how to detect this, what the uni types are and the flags indicating which is being used?
TIA
At 20 FEB 2003 04:47PM Richard Bright wrote:
Real intersted in any info in this area - have been trying to sort out display of Jpeg which maintained aspect ratio and resizeable. Had searched for simple (preferably public domain) OCX without luck. One alternative was using embeded browser and encasulating the Jpeg file path in html - so can set size etc and writing out to html - the pass to browser. But this seems just a work - round.
Richard - can you point me to Eric the Emu's notes on extracting size? At least it might move me one step ahead.
Richard Bright
BrightIdeas New Zealand
r.bright@ark.co.nz
At 20 FEB 2003 06:05PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Have you tried using the ImageMan DLL functions? You can use them to read in the Jpeg and extract it's sizeā¦
World Leaders in all things RevSoft
At 21 FEB 2003 01:25AM Richard Bright wrote:
I confess that the very smart people from VSL suggested that, but being a proud ingnorant peasant I didnt own up to not sure what to do.
richard (ver small print)
At 21 FEB 2003 06:21AM Richard Guise wrote:
Many thanks, Sprezz.
I'd love to make lots more use of imageman capabilities not used in OI but which I'm sure are absolutely itching to be used - e.g. to zoom images as well as pan them.
However, I have not seen anywhere any documentation as to what can be done via imageman.dll or how.
Like Richard B (and as you personally know), I too am just a simple ignorant peasant when we venture deep into the techie jungle.
Can Sprezz or anyone else be so kind as to give the ignorant peasants a simple guide (or a pointer to one) where we can open up these fantastic new possibilities?
Many thanks in anticipation.
P.S. The Eric the Emu article was in a SENL on the Sprezz web site (I forget which issue) but I also did web search and quite quickly found the same procedure on another site elsewhere. As noted neither coped correctly with the Casio Jpeg.
At 21 FEB 2003 06:32AM Richard Guise wrote:
Richard B
Since my last message I've just done internet search on "imageman" and you can download manual on the Imageman dll Suite" in PDF format from www.data-tech.com.
I haven't read it yet, but it vlooks like a very useful start.
Richard G
At 21 FEB 2003 05:25PM Richard Bright wrote:
Many thanks for the pointer to the Imageman dll Suite pdf. Have downloaded and will read and inwardly digest. Was interested to read that the controls have capability of lot more than presently exposed to us - before reading the documentation, start to muse if these advanced capabilities might be made available to us within OI?
Thanks again.
Richard Bright
At 22 FEB 2003 01:11AM Estate of the late Eric Emu wrote:
It took the said Emu about a week of looking at hexdumps of pornographic *.jpg files to guess at the solution here:
http://www.sprezzatura.com/volume_3_issue_1.htm
Eric looked at the *.jpg file dimensions in a web browser, then tried to locate the binary x & y dimension values inside the file itself. Then he noticed that they were always in the last frame (delimited by \FFC0\), and always a set number of bytes after the \FFC0\ delimiter.
Perhaps it was because all the *.jpg files tested had nudes in them.
It could also be a later version of the jpeg file specification that the Casio observes. Especially since Eric never owned a camera. Eric preferred water colors. Or inhaling the fumes from the occasional spray paint canister.
You could always purchase the jpeg file format specification and roll your own routine.
If Eric had known better, and hadn't been trying to reverse engineer the spec, he might have simply found an article like the following:
http://www.ddj.com/forums/thread.html?forumid=44&threadid=666
To impute that Eric's technique was readily available elsewhere brings disrepute to a creature whose reputation can only be elevated by libellous remarks. Eric never copied anyone else's work. He was far, far too stupid to have any friends to copy from. Besides, emus don't read reading - they only read writing.
Hicks & Oakley Solicitors
on behalf of the Estate of the late and never dead on time Eric Emu
At 22 FEB 2003 07:09AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
We're pleased that both your own efforts and those of the sorely missed emu have been suitably rewarded with knowledge. Regretfully we can't actually chip in with the Imageman stuff as a client recently paid us to research this information for them and it wouldn't be on to document publicly what they have paid for until a decent time period has elapsed.
World Leaders in all things RevSoft
At 22 FEB 2003 08:59PM Richard Bright wrote:
Was Eric the Emu a casualty of the Big Dry?
BTW had located the Senl, digested and rolled the JPG/GIF/BMP into one routine and successfully tried it as part of a Browser based Html image sizing. I can now do something that can zoom etc.
Next to try with the Image Manager dll. Just amazed at the possibilities with this facility.
Richard
At 25 FEB 2003 08:22AM Richard Guise wrote:
Dear H & O
Thanks for these rare and invaluable glimpses into the mind of the always-late Emu.
I tried looking for the two-byte strings of height and width of a Casio-type Jpeg image of which I knew the size (separately and each of them both ways round) - but could find no match on which to then research further how to locate these details.
The figures produced by the Emu's routine seemed to bear the same aspect ratio but didn't factor up to the correct size. Other references to Jpeg headers don't seem to mention any alternative formats or dimension types.
In conclusion, I never imagined that the Emu had copied anyone else's work - as you say, in spite of their undoubted abilities in certain other directions, emus seem to have no friends, can only read and write in machine code, hex and other stuff that is only intelligible to Martians and a very few humans. Their main communication must therefore perforce be with machines rather than with other creatures. Would I be right that the Emu learned to read at school by running punched tape through his fingers and to write by punching tape with his teeth?