Home | History | Annotate | Download | only in jhead

Lines Matching defs:Data

47 static void process_COM (const uchar * Data, int length)
59 ch = Data[a];
61 if (ch == '\r' && Data[a+1] == '\n') continue; // Remove cr followed by lf.
84 static void process_SOFn (const uchar * Data, int marker)
88 data_precision = Data[2];
89 ImageInfo.Height = Get16m(Data+3);
90 ImageInfo.Width = Get16m(Data+5);
91 num_components = Data[7];
120 ErrFatal("could not allocate data for entire image");
143 uchar * Data;
175 Data = (uchar *)malloc(itemlen);
176 if (Data == NULL){
181 Sections[SectionsRead].Data = Data;
184 Data[0] = (uchar)lh;
185 Data[1] = (uchar)ll;
187 got = fread(Data+2, 1, itemlen-2, infile); // Read the whole section.
198 case M_SOS: // stop before hitting compressed data
199 // If reading entire image is requested, read the rest of the data.
209 Data = (uchar *)malloc(size);
210 if (Data == NULL){
211 // ErrFatal("could not allocate data for entire image");
212 ALOGE("could not allocate data for entire image");
216 got = fread(Data, 1, size, infile);
224 Sections[SectionsRead].Data = Data;
240 free(Sections[--SectionsRead].Data);
242 process_COM(Data, itemlen);
252 free(Sections[--SectionsRead].Data);
258 if (memcmp(Data+2, "Exif", 4) == 0){
259 process_EXIF(Data, itemlen);
261 }else if (memcmp(Data+2, "http:", 5) == 0){
273 free(Sections[--SectionsRead].Data);
284 free(Sections[--SectionsRead].Data);
301 process_SOFn(Data, marker);
341 uchar * Data;
371 Data = (uchar *)malloc(itemlen);
372 if (Data == NULL) {
376 Sections[SectionsRead].Data = Data;
379 Data[0] = (uchar)lh;
380 Data[1] = (uchar)ll;
387 memcpy(Data+2, buffer+pos, itemlen-2); // Read the whole section.
395 case M_SOS: // stop before hitting compressed data
396 // If reading entire image is requested, read the rest of the data.
406 Data = (uchar *)malloc(size);
407 if (Data == NULL) {
408 ALOGE("%d: could not allocate data for entire image size: %d", __LINE__, size);
412 memcpy(Data, buffer+pos, size);
415 Sections[SectionsRead].Data = Data;
431 free(Sections[--SectionsRead].Data);
433 process_COM(Data, itemlen);
443 free(Sections[--SectionsRead].Data);
449 if (memcmp(Data+2, "Exif", 4) == 0){
450 process_EXIF(Data, itemlen);
452 }else if (memcmp(Data+2, "http:", 5) == 0){
464 free(Sections[--SectionsRead].Data);
475 free(Sections[--SectionsRead].Data);
492 process_SOFn(Data, marker);
506 // Discard read data.
513 free(Sections[a].Data);
522 // Read image data.
578 ThumbnailPointer = ExifSection->Data+ImageInfo.ThumbnailOffset+8;
632 ExifSection->Data = (uchar *)realloc(ExifSection->Data, NewExifSize);
634 ThumbnailPointer = ExifSection->Data+ImageInfo.ThumbnailOffset+8;
642 Put32u(ExifSection->Data+ImageInfo.ThumbnailSizeOffset+8, ThumbLen);
644 ExifSection->Data[0] = (uchar)(NewExifSize >> 8);
645 ExifSection->Data[1] = (uchar)NewExifSize;
712 ExifSection->Data = (uchar *)realloc(ExifSection->Data, NewExifSize);
714 ThumbnailPointer = ExifSection->Data+ImageInfo.ThumbnailOffset+8;
723 Put32u(ExifSection->Data+ImageInfo.ThumbnailSizeOffset+8, ThumbLen);
725 ExifSection->Data[0] = (uchar)(NewExifSize >> 8);
726 ExifSection->Data[1] = (uchar)NewExifSize;
762 free(Sections[a].Data);
786 // Write image data back to disk.
824 nWrite = fwrite(Sections[a].Data, 1, Sections[a].Size, outfile);
832 // Write the remaining image data.
834 nWrite = fwrite(Sections[a].Data, 1,Sections[a].Size, outfile);
891 memcpy(buffer+pos, Sections[a].Data, Sections[a].Size);
896 // Write the remaining image data.
901 memcpy(buffer+pos, Sections[a].Data, Sections[a].Size);
935 free (Sections[a].Data);
983 free (Sections[a].Data);
997 Section_t * CreateSection(int SectionType, unsigned char * Data, int Size)
1025 NewSection->Data = Data;