Lines Matching full:sections

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