Lines Matching defs:Sections
18 static Section_t * Sections = NULL;
109 // Check sections array to see if it needs to be increased in size.
118 Sections = (Section_t *)realloc(Sections, sizeof(Section_t)*SectionsAllocated);
119 if (Sections == NULL){
158 Sections[SectionsRead].Type = marker;
159 Sections[SectionsRead].Offset = ftell(infile);
173 Sections[SectionsRead].Size = itemlen;
181 Sections[SectionsRead].Data = Data;
224 Sections[SectionsRead].Data = Data;
225 Sections[SectionsRead].Offset = cp;
226 Sections[SectionsRead].Size = size;
227 Sections[SectionsRead].Type = PSEUDO_IMAGE_MARKER;
240 free(Sections[--SectionsRead].Data);
252 free(Sections[--SectionsRead].Data);
262 Sections[SectionsRead-1].Type = M_XMP; // Change tag for internal purposes.
266 ShowXmp(Sections[SectionsRead-1]);
273 free(Sections[--SectionsRead].Data);
284 free(Sections[--SectionsRead].Data);
304 // Skip any other sections.
355 Sections[SectionsRead].Type = marker;
356 Sections[SectionsRead].Offset = pos;
369 Sections[SectionsRead].Size = itemlen;
376 Sections[SectionsRead].Data = Data;
415 Sections[SectionsRead].Data = Data;
416 Sections[SectionsRead].Offset = pos;
417 Sections[SectionsRead].Size = size;
418 Sections[SectionsRead].Type = PSEUDO_IMAGE_MARKER;
431 free(Sections[--SectionsRead].Data);
443 free(Sections[--SectionsRead].Data);
453 Sections[SectionsRead-1].Type = M_XMP; // Change tag for internal purposes.
457 ShowXmp(Sections[SectionsRead-1]);
464 free(Sections[--SectionsRead].Data);
475 free(Sections[--SectionsRead].Data);
495 // Skip any other sections.
513 free(Sections[a].Data);
541 ALOGV("Cannot parse JPEG sections for file: %s", FileName);
737 // Discard everything but the exif and comment sections.
753 if (Sections[a].Type == M_EXIF && ExifKeeper.Type == 0){
754 ExifKeeper = Sections[a];
755 }else if (Sections[a].Type == M_XMP && XmpKeeper.Type == 0){
756 XmpKeeper = Sections[a];
757 }else if (Sections[a].Type == M_COM && CommentKeeper.Type == 0){
758 CommentKeeper = Sections[a];
759 }else if (Sections[a].Type == M_IPTC && IptcKeeper.Type == 0){
760 IptcKeeper = Sections[a];
762 free(Sections[a].Data);
768 Sections[SectionsRead++] = ExifKeeper;
772 Sections[SectionsRead++] = CommentKeeper;
776 Sections[SectionsRead++] = IptcKeeper;
781 Sections[SectionsRead++] = XmpKeeper;
808 if (Sections[0].Type != M_EXIF && Sections[0].Type != M_JFIF){
820 // Write all the misc sections
823 fputc((unsigned char)Sections[a].Type, outfile);
824 nWrite = fwrite(Sections[a].Data, 1, Sections[a].Size, outfile);
825 writeOk = (nWrite == Sections[a].Size);
827 ALOGE("write section %d failed expect %d actual %d",a,Sections[a].Size,nWrite);
834 nWrite = fwrite(Sections[a].Data, 1,Sections[a].Size, outfile);
835 writeOk = (nWrite == Sections[a].Size);
837 ALOGE("write section %d failed expect %d actual %d",a,Sections[a].Size,nWrite);
870 if (Sections[0].Type != M_EXIF && Sections[0].Type != M_JFIF){
883 // Write all the misc sections
886 buffer[pos++] = (unsigned char) Sections[a].Type;
887 if (pos+Sections[a].Size > buffer_size) {
891 memcpy(buffer+pos, Sections[a].Data, Sections[a].Size);
892 pos += Sections[a].Size;
898 if (pos+Sections[a].Size > buffer_size) {
901 memcpy(buffer+pos, Sections[a].Data, Sections[a].Size);
902 pos += Sections[a].Size;
918 if (Sections[a].Type == SectionType){
919 return &Sections[a];
933 if (Sections[a].Type == SectionType){
935 free (Sections[a].Data);
936 // Move succeding sections back by one to close space in array.
937 memmove(Sections+a, Sections+a+1, sizeof(Section_t) * (SectionsRead-a));
946 // Remove sectons not part of image and not exif or comment sections.
953 switch(Sections[a].Type){
983 free (Sections[a].Data);
984 // Move succeding sections back by one to close space in array.
985 memmove(Sections+a, Sections+a+1, sizeof(Section_t) * (SectionsRead-a));
995 // adding comment sections and exif sections
1010 // ErrFatal("Too few sections!");
1011 ALOGE("Too few sections!");
1017 Sections[a] = Sections[a-1];
1021 NewSection = Sections+NewIndex;
1036 if (Sections == NULL){
1037 Sections = (Section_t *)malloc(sizeof(Section_t)*5);