I'm getting a width = 0 and height = 0 when I used pnoJPeg2GetInfo after
calling pnoJpeg2LoadFromVFS... Here is my code:
UInt16 nJpegWidth, nJpegHeight;
Char *dimsStr1;
Char *dimsStr2;
if ((err = pnoJpeg2Create(pnoJpegRefNum, &jpegData)) == errNone) {
if ((err = pnoJpeg2LoadFromVFS(pnoJpegRefNum, jpegData,
volRefNum,"/testJpeg.jpg")) == errNone) {
if ((err = pnoJpeg2GetInfo(pnoJpegRefNum, jpegData, (Coord *)&nJpegWidth,
(Coord *)&nJpegHeight)) == errNone) {
dimsStr1 = (Char *)MemPtrNew(sizeof(Char *));
dimsStr2 = (Char *)MemPtrNew(sizeof(Char *));
ErrDisplay(StrIToA(dimsStr1,nJpegWidth));
ErrDisplay(StrIToA(dimsStr2,nJpegHeight));
MemPtrFree(dimsStr1);
MemPtrFree(dimsStr2);
}
}
}
I noticed that pnoJpeg2LoadFromVFS does not return any errors even if I
deliberatly put in the wrong path. I'm guessing that jpegData is not being
loaded by pnoJpeg2LoadFromVFS...
I also tried to use pnoJpeg2LoadFromHandle by first using MemHandleNew to
allocate the correct amount of space, locking the handle and then calling
VFSFileRead to load the handle. The jpg file was then loaded into the handle
by pnoJpeg2LoadFromHandle. But when I called pnoJpeg2GetInfo, the width
returned was 2083 and the height was 0. Really weird... because, I was able
to run the DEMO app at:
http://www.bin-people.de/pnoJpegLib/
and display the JPG but when I copied line by line what was in the demo code
into my own app, nothing gets displayed... anyone have any ideas?
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/