home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15412 < prev    next >
Encoding:
Internet Message Format  |  1992-09-12  |  2.6 KB

  1. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!rpi!usenet.coe.montana.edu!news.u.washington.edu!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!tgl
  2. From: tgl+@cs.cmu.edu (Tom Lane)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: JPEG <-> JFIF with QT.
  5. Message-ID: <BuI2pL.92z.2@cs.cmu.edu>
  6. Date: 13 Sep 92 04:48:56 GMT
  7. Article-I.D.: cs.BuI2pL.92z.2
  8. References: <mackid-280892211810@toysrus.engin.umich.edu.> <1992Sep4.173121.10616@waikato.ac.nz>
  9. Sender: news@cs.cmu.edu (Usenet News System)
  10. Organization: School of Computer Science, Carnegie Mellon
  11. Lines: 41
  12. Nntp-Posting-Host: g.gp.cs.cmu.edu
  13.  
  14. (Sorry for the slow response ... don't read this group often.)
  15.  
  16. mackid@engin.umich.edu (Mike Neil) says:
  17. > the data portion that is returned from a
  18. > CompressImage call is in the JFIF format (Someone give the QT guys another
  19. > cookie).  So basically you can read a JFIF file into memory pass it into
  20. > the DecompressImage call (You will need to make a Info block by hand).
  21. > and you will get a decompressed image out.  Very Cool.
  22.  
  23. I don't recall offhand whether QT makes a true JFIF file (complete with JFIF
  24. marker) or just a "raw JPEG" file.  Either way, though, the information is
  25. compatible with non-Mac JFIF/JPEG programs.  The JFIF marker is considered
  26. optional by most non-Mac decoders; it really just certifies that the file
  27. adheres to the JFIF conventions about colorspace.
  28.  
  29. > Couldn't find any mention of this in the QT docs so my guess is
  30. > it is an unsupported feature.
  31.  
  32. I think it's reasonably safe to rely on it --- Apple's chief JPEG engineer
  33. has spent a good deal of time making sure QT is compatible with JFIF-based
  34. decoders :-)
  35.  
  36. And ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  37. > Here's one useful piece of information about the JPEG data stream, for those
  38. > (like me) who have never seen a copy of the JPEG spec: if you want to
  39. > determine the size of the image, look for a hex FF byte followed by a hex C0
  40. > byte. Skip the next three bytes, and you will find a 2-byte integer
  41. > containing the number of lines, followed by a 2-byte integer containing the
  42. > number of columns.
  43.  
  44. Bzzt.  Sorry, but that method is guaranteed to break sooner or later.  If
  45. you want reliable info, you have to parse the JPEG marker sequence, at least
  46. well enough to skip over the arbitrary data that may be inside marker bodies
  47. preceding the SOF marker.
  48.  
  49. If you don't want to buy a copy of the JPEG standard, at least go read the
  50. free JPEG code available from ftp.uu.net: graphics/jpeg/ ... in particular,
  51. jrdjfif.c will show you how to do this right.  It only takes a few more
  52. lines of code.
  53.  
  54.                 regards, tom lane
  55.