|
And don't forget to pay attention to Little vs Big endian issues (Byte Ordering). The AS/400 is Big endian, Intel is little. Unix is both depending on platform. Bob -----Original Message----- From: owner-midrange-l@midrange.com [mailto:owner-midrange-l@midrange.com]On Behalf Of John Taylor Sent: Sunday, August 27, 2000 11:15 AM To: MIDRANGE-L@midrange.com Subject: RE: Retrieving JPG and GIF file data in an AS/400 program Rob, The following excerpt is from the JPEG-FAQ: Subject: [22] How can my program extract image dimensions from a JPEG file? The header of a JPEG file consists of a series of blocks, called "markers". The image height and width are stored in a marker of type SOFn (Start Of Frame, type N). To find the SOFn you must skip over the preceding markers; you don't have to know what's in the other types of markers, just use their length words to skip over them. The minimum logic needed is perhaps a page of C code. (Some people have recommended just searching for the byte pair representing SOFn, without paying attention to the marker block structure. This is unsafe because a prior marker might contain the SOFn pattern, either by chance or because it contains a JPEG-compressed thumbnail image. If you don't follow the marker structure you will retrieve the thumbnail's size instead of the main image size.) A profusely commented example in C can be found in rdjpgcom.c in the IJG distribution (see part 2, item 15). Perl code can be found in wwwis, from http://www.tardis.ed.ac.uk/~ark/wwwis/. The entire faq (2 parts) can be retrieved from the following FTP location: ftp://rtfm.mit.edu/pub/usenet-by-hierarchy/news/answers/jpeg-faq/ Have fun, John Taylor Canada > -----Original Message----- > From: owner-midrange-l@midrange.com > [mailto:owner-midrange-l@midrange.com]On Behalf Of Rob Dixon > Sent: Sunday, August 27, 2000 4:50 AM > To: MIDRANGE-L@midrange.com > Subject: Retrieving JPG and GIF file data in an AS/400 program > > > I have been asked to load about 25,000 images into an AS/400 web site > with the prospect of rather larger quantities to come. I store them in > the IFS and the transfer is not a problem. My product ERROS was used to > build the web site. This generates HTML on the fly and automatically > changes the image size dependent upon the number of images displayed on > the screen at any one time. To do this, and to make sure that I do not > display an image in a size greater than its size as supplied, I need to > store the image size data for each image in my Neural Database. So far > I have only put up a few hundred images and I have put this information > in manually, but, with this quantity of images, I need to automate the > process. > > Does anyone know how to extract the image size data from image files in > the IFS using an AS/400 program or even where it is stored in a JPG or > GIF file? The files will have been created in Adobe Photoshop. > > Many thanks > > Rob Dixon > ________________________________________________________ > > Erros plc > > 44 (0) 1844 239 339 > > http://www.erros.co.uk - The AS/400 Neural Database for the Internet > > _________________________________________________________ > > > +--- > | This is the Midrange System Mailing List! > | To submit a new message, send your mail to MIDRANGE-L@midrange.com. > | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. > | To unsubscribe from this list send email to > MIDRANGE-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: > david@midrange.com > +--- > +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.