That is the code from Jpeg Libarry sample
(http://www.absoluteword.com/jpglib/)
Try to open PDB as a stream and read the data into flat chunk of memory.
// test JPEG on start
fh = FileOpen(0,"Lake.jpg",NULL,NULL,fileModeReadOnly,&err);
if (err == errNone) {
FileTell(fh,&size,&err);
data = MemLargePtrNew(size);
if (data) {
FileRead(fh,data,size,1,&err);
bmpP = jpeg(data,progressF,initF,errorF);
MemPtrFree(data);
}
FileClose(fh);
} else {
--
Konstantin
"Rodrigo Borges" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> i am developing an application that should read a PDB file which contains
> a JPEG, GIF or BMP file. I got an application that makes this kind of PDB
> called palmimage
> and i'm using the JpegLib to read this pdb and decode it into the
> BitmapPtr.
>
> When i create the PDB image from the Photo Application using the JpegLib,
it
> works really fine. But when i create the PDB using the palmimage and run
> with the JpegLib functions it didn't work. Certainly the jpeglib is
correct
> and probably the palmimage is incorrect or the JpegLib functions don't
read
> the PDB as the palmimage created. Well, does anybody know any document
that
> explains or an open source that converts a jpeg or gif into a pdb file?
>
> I've studied the pdb format after the conversion of the Photo Application
> and i discovered some standards things like always
> the record begins with a string DBLK and then a number which i think it
> means the number of bytes that the jpeg's frame has. And the limit of
bytes
> is 4104 for each record.
>
> I've searched at the PalmOS Developer Forum for this kind of problem but i
> wasn't able to find anything.
>
> Thanks a lot,
> Rodrigo
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/