Lines Matching refs:bufLen
510 static int addKeyValueString(char** buf, int bufLen, const char* key, const char* value) { in addKeyValueString() argument
519 if (newLen >= bufLen) { in addKeyValueString()
521 bufLen = newLen + 5; in addKeyValueString()
522 ALOGE("reallocing to %d", bufLen); in addKeyValueString()
524 bufLen = newLen + 500; in addKeyValueString()
526 *buf = realloc(*buf, bufLen); in addKeyValueString()
532 snprintf(*buf + strlen(*buf), bufLen, "%s%s%s", key, valueLen, value); in addKeyValueString()
537 return bufLen; in addKeyValueString()
541 static int addKeyValueInt(char** buf, int bufLen, const char* key, int value) { in addKeyValueInt() argument
545 return addKeyValueString(buf, bufLen, key, valueStr); in addKeyValueInt()
549 static int addKeyValueDouble(char** buf, int bufLen, const char* key, double value, const char* for… in addKeyValueDouble() argument
553 return addKeyValueString(buf, bufLen, key, valueStr); in addKeyValueDouble()
557 static int addKeyValueRational(char** buf, int bufLen, const char* key, rat_t value) { in addKeyValueRational() argument
560 return addKeyValueString(buf, bufLen, key, valueStr); in addKeyValueRational()
577 int bufLen = 5; in getAttributes() local
579 int bufLen = 1000; in getAttributes() local
581 char* buf = malloc(bufLen); in getAttributes()
588 bufLen = addKeyValueString(&buf, bufLen, "hasThumbnail", in getAttributes()
591 if (bufLen == 0) return NULL; in getAttributes()
594 bufLen = addKeyValueString(&buf, bufLen, "Make", ImageInfo.CameraMake); in getAttributes()
595 if (bufLen == 0) return NULL; in getAttributes()
598 bufLen = addKeyValueString(&buf, bufLen, "Model", ImageInfo.CameraModel); in getAttributes()
599 if (bufLen == 0) return NULL; in getAttributes()
602 bufLen = addKeyValueString(&buf, bufLen, "DateTime", ImageInfo.DateTime); in getAttributes()
603 if (bufLen == 0) return NULL; in getAttributes()
606 bufLen = addKeyValueString(&buf, bufLen, "DateTimeDigitized", ImageInfo.DigitizedTime); in getAttributes()
607 if (bufLen == 0) return NULL; in getAttributes()
610 bufLen = addKeyValueString(&buf, bufLen, "SubSecTime", ImageInfo.SubSecTime); in getAttributes()
611 if (bufLen == 0) return NULL; in getAttributes()
614 bufLen = addKeyValueString(&buf, bufLen, "SubSecTimeOriginal", ImageInfo.SubSecTimeOrig); in getAttributes()
615 if (bufLen == 0) return NULL; in getAttributes()
618 bufLen = addKeyValueString(&buf, bufLen, "SubSecTimeDigitized", ImageInfo.SubSecTimeDig); in getAttributes()
619 if (bufLen == 0) return NULL; in getAttributes()
622 bufLen = addKeyValueInt(&buf, bufLen, "ImageWidth", ImageInfo.Width); in getAttributes()
623 if (bufLen == 0) return NULL; in getAttributes()
625 bufLen = addKeyValueInt(&buf, bufLen, "ImageLength", ImageInfo.Height); in getAttributes()
626 if (bufLen == 0) return NULL; in getAttributes()
628 bufLen = addKeyValueInt(&buf, bufLen, "Orientation", ImageInfo.Orientation); in getAttributes()
629 if (bufLen == 0) return NULL; in getAttributes()
632 bufLen = addKeyValueInt(&buf, bufLen, "Flash", ImageInfo.FlashUsed); in getAttributes()
633 if (bufLen == 0) return NULL; in getAttributes()
637 bufLen = addKeyValueRational(&buf, bufLen, "FocalLength", ImageInfo.FocalLength); in getAttributes()
638 if (bufLen == 0) return NULL; in getAttributes()
643 … bufLen = addKeyValueDouble(&buf, bufLen, "DigitalZoomRatio", ImageInfo.DigitalZoomRatio, "%1.3f"); in getAttributes()
644 if (bufLen == 0) return NULL; in getAttributes()
655 … bufLen = addKeyValueDouble(&buf, bufLen, "ExposureTime", (double)ImageInfo.ExposureTime, format); in getAttributes()
656 if (bufLen == 0) return NULL; in getAttributes()
660 … bufLen = addKeyValueDouble(&buf, bufLen, "FNumber", (double)ImageInfo.ApertureFNumber, "%3.3f"); in getAttributes()
661 if (bufLen == 0) return NULL; in getAttributes()
665 … bufLen = addKeyValueDouble(&buf, bufLen, "SubjectDistance", (double)ImageInfo.Distance, "%4.2f"); in getAttributes()
666 if (bufLen == 0) return NULL; in getAttributes()
670 bufLen = addKeyValueInt(&buf, bufLen, "ISOSpeedRatings", ImageInfo.ISOequivalent); in getAttributes()
671 if (bufLen == 0) return NULL; in getAttributes()
677 …bufLen = addKeyValueDouble(&buf, bufLen, "ExposureBiasValue", (double)ImageInfo.ExposureBias, "%4.… in getAttributes()
678 if (bufLen == 0) return NULL; in getAttributes()
682 bufLen = addKeyValueInt(&buf, bufLen, "WhiteBalance", ImageInfo.Whitebalance); in getAttributes()
683 if (bufLen == 0) return NULL; in getAttributes()
686 bufLen = addKeyValueInt(&buf, bufLen, "LightSource", ImageInfo.LightSource); in getAttributes()
687 if (bufLen == 0) return NULL; in getAttributes()
691 bufLen = addKeyValueInt(&buf, bufLen, "MeteringMode", ImageInfo.MeteringMode); in getAttributes()
692 if (bufLen == 0) return NULL; in getAttributes()
696 bufLen = addKeyValueInt(&buf, bufLen, "ExposureProgram", ImageInfo.ExposureProgram); in getAttributes()
697 if (bufLen == 0) return NULL; in getAttributes()
701 bufLen = addKeyValueInt(&buf, bufLen, "ExposureMode", ImageInfo.ExposureMode); in getAttributes()
702 if (bufLen == 0) return NULL; in getAttributes()
707 bufLen = addKeyValueString(&buf, bufLen, "GPSLatitude", ImageInfo.GpsLatRaw); in getAttributes()
708 if (bufLen == 0) return NULL; in getAttributes()
711 bufLen = addKeyValueString(&buf, bufLen, "GPSLatitudeRef", ImageInfo.GpsLatRef); in getAttributes()
712 if (bufLen == 0) return NULL; in getAttributes()
715 bufLen = addKeyValueString(&buf, bufLen, "GPSLongitude", ImageInfo.GpsLongRaw); in getAttributes()
716 if (bufLen == 0) return NULL; in getAttributes()
719 bufLen = addKeyValueString(&buf, bufLen, "GPSLongitudeRef", ImageInfo.GpsLongRef); in getAttributes()
720 if (bufLen == 0) return NULL; in getAttributes()
723 bufLen = addKeyValueRational(&buf, bufLen, "GPSAltitude", ImageInfo.GpsAltRaw); in getAttributes()
724 bufLen = addKeyValueInt(&buf, bufLen, "GPSAltitudeRef", ImageInfo.GpsAltRef); in getAttributes()
725 if (bufLen == 0) return NULL; in getAttributes()
728 bufLen = addKeyValueString(&buf, bufLen, "GPSDateStamp", ImageInfo.GpsDateStamp); in getAttributes()
729 if (bufLen == 0) return NULL; in getAttributes()
732 bufLen = addKeyValueString(&buf, bufLen, "GPSTimeStamp", ImageInfo.GpsTimeStamp); in getAttributes()
733 if (bufLen == 0) return NULL; in getAttributes()
736 … bufLen = addKeyValueString(&buf, bufLen, "GPSProcessingMethod", ImageInfo.GpsProcessingMethod); in getAttributes()
737 if (bufLen == 0) return NULL; in getAttributes()
742 bufLen = addKeyValueString(&buf, bufLen, "UserComment", ImageInfo.Comments); in getAttributes()
743 if (bufLen == 0) return NULL; in getAttributes()