From: Jan P. <pa...@pi...> - 2005-03-17 13:24:26
|
I never remember which is little-endian and which is big-endian. And I must admit I didn't decipher the _be_ and _le_ letter in the function names :-( In any case Lutz's code was wrong: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D static int cmp_be_func (const void *elem1, const void *elem2) { return cmp_func ((const unsigned char *) elem1, (const unsigned char *) elem2, EXIF_BYTE_ORDER_INTEL); } static int cmp_le_func (const void *elem1, const void *elem2) { return cmp_func ((const unsigned char *) elem1, (const unsigned char *) elem2, EXIF_BYTE_ORDER_MOTOROLA); } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D data->priv->order =3D=3D EXIF_BYTE_ORDER_INTEL ? cmp_le_func : cmp_be_fun= c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Are you saying I should have changed bodies of cmp_le_func & cmp_be_func instead? -- Jan > Jan Patera <pa...@us...> writes: > >> Update of /cvsroot/libexif/libexif/libexif >> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19628 >> >> Modified Files: >> exif-data.c >> Log Message: >> Corrected byte ordering when sorting tags. >> >> >> Index: exif-data.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> RCS file: /cvsroot/libexif/libexif/libexif/exif-data.c,v >> retrieving revision 1.70 >> retrieving revision 1.71 >> diff -u -d -r1.70 -r1.71 >> --- exif-data.c 16 Mar 2005 07:33:05 -0000 1.70 >> +++ exif-data.c 17 Mar 2005 07:43:39 -0000 1.71 >> @@ -576,7 +576,7 @@ >> /* Sort the directory according to TIFF specification */ >> qsort (*d + 6 + offset - (ifd->count + n_ptr + n_thumb) * 12, >> (ifd->count + n_ptr + n_thumb), 12, >> - data->priv->order =3D=3D EXIF_BYTE_ORDER_INTEL ? cmp_le_func : >> cmp_be_func); + data->priv->order =3D=3D EXIF_BYTE_ORDER_INTEL ? >> cmp_be_func : cmp_le_func); >> >> /* Correctly terminate the directory */ >> if (i =3D=3D EXIF_IFD_0 && (data->ifd[EXIF_IFD_1]->count || > > I thought Intel byte order was little endian? > > Uli > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users= . > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > Libexif-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libexif-devel |