Lines Matching refs:bufLen
510 static int addKeyValueString(char** buf, int bufLen, const char* key, const char* value) {
519 if (newLen >= bufLen) {
521 bufLen = newLen + 5;
522 ALOGE("reallocing to %d", bufLen);
524 bufLen = newLen + 500;
526 *buf = realloc(*buf, bufLen);
532 snprintf(*buf + strlen(*buf), bufLen, "%s%s%s", key, valueLen, value);
537 return bufLen;
541 static int addKeyValueInt(char** buf, int bufLen, const char* key, int value) {
545 return addKeyValueString(buf, bufLen, key, valueStr);
549 static int addKeyValueDouble(char** buf, int bufLen, const char* key, double value, const char* format) {
553 return addKeyValueString(buf, bufLen, key, valueStr);
557 static int addKeyValueRational(char** buf, int bufLen, const char* key, rat_t value) {
560 return addKeyValueString(buf, bufLen, key, valueStr);
577 int bufLen = 5;
579 int bufLen = 1000;
581 char* buf = malloc(bufLen);
588 bufLen = addKeyValueString(&buf, bufLen, "hasThumbnail",
591 if (bufLen == 0) return NULL;
594 bufLen = addKeyValueString(&buf, bufLen, "Make", ImageInfo.CameraMake);
595 if (bufLen == 0) return NULL;
598 bufLen = addKeyValueString(&buf, bufLen, "Model", ImageInfo.CameraModel);
599 if (bufLen == 0) return NULL;
602 bufLen = addKeyValueString(&buf, bufLen, "DateTime", ImageInfo.DateTime);
603 if (bufLen == 0) return NULL;
605 bufLen = addKeyValueInt(&buf, bufLen, "ImageWidth", ImageInfo.Width);
606 if (bufLen == 0) return NULL;
608 bufLen = addKeyValueInt(&buf, bufLen, "ImageLength", ImageInfo.Height);
609 if (bufLen == 0) return NULL;
611 bufLen = addKeyValueInt(&buf, bufLen, "Orientation", ImageInfo.Orientation);
612 if (bufLen == 0) return NULL;
615 bufLen = addKeyValueInt(&buf, bufLen, "Flash", ImageInfo.FlashUsed);
616 if (bufLen == 0) return NULL;
620 bufLen = addKeyValueRational(&buf, bufLen, "FocalLength", ImageInfo.FocalLength);
621 if (bufLen == 0) return NULL;
626 bufLen = addKeyValueDouble(&buf, bufLen, "DigitalZoomRatio", ImageInfo.DigitalZoomRatio, "%1.3f");
627 if (bufLen == 0) return NULL;
638 bufLen = addKeyValueDouble(&buf, bufLen, "ExposureTime", (double)ImageInfo.ExposureTime, format);
639 if (bufLen == 0) return NULL;
643 bufLen = addKeyValueDouble(&buf, bufLen, "FNumber", (double)ImageInfo.ApertureFNumber, "%3.1f");
644 if (bufLen == 0) return NULL;
648 bufLen = addKeyValueDouble(&buf, bufLen, "SubjectDistance", (double)ImageInfo.Distance, "%4.2f");
649 if (bufLen == 0) return NULL;
653 bufLen = addKeyValueInt(&buf, bufLen, "ISOSpeedRatings", ImageInfo.ISOequivalent);
654 if (bufLen == 0) return NULL;
660 bufLen = addKeyValueDouble(&buf, bufLen, "ExposureBiasValue", (double)ImageInfo.ExposureBias, "%4.2f");
661 if (bufLen == 0) return NULL;
665 bufLen = addKeyValueInt(&buf, bufLen, "WhiteBalance", ImageInfo.Whitebalance);
666 if (bufLen == 0) return NULL;
669 bufLen = addKeyValueInt(&buf, bufLen, "LightSource", ImageInfo.LightSource);
670 if (bufLen == 0) return NULL;
674 bufLen = addKeyValueInt(&buf, bufLen, "MeteringMode", ImageInfo.MeteringMode);
675 if (bufLen == 0) return NULL;
679 bufLen = addKeyValueInt(&buf, bufLen, "ExposureProgram", ImageInfo.ExposureProgram);
680 if (bufLen == 0) return NULL;
684 bufLen = addKeyValueInt(&buf, bufLen, "ExposureMode", ImageInfo.ExposureMode);
685 if (bufLen == 0) return NULL;
690 bufLen = addKeyValueString(&buf, bufLen, "GPSLatitude", ImageInfo.GpsLatRaw);
691 if (bufLen == 0) return NULL;
694 bufLen = addKeyValueString(&buf, bufLen, "GPSLatitudeRef", ImageInfo.GpsLatRef);
695 if (bufLen == 0) return NULL;
698 bufLen = addKeyValueString(&buf, bufLen, "GPSLongitude", ImageInfo.GpsLongRaw);
699 if (bufLen == 0) return NULL;
702 bufLen = addKeyValueString(&buf, bufLen, "GPSLongitudeRef", ImageInfo.GpsLongRef);
703 if (bufLen == 0) return NULL;
706 bufLen = addKeyValueRational(&buf, bufLen, "GPSAltitude", ImageInfo.GpsAltRaw);
707 bufLen = addKeyValueInt(&buf, bufLen, "GPSAltitudeRef", ImageInfo.GpsAltRef);
708 if (bufLen == 0) return NULL;
711 bufLen = addKeyValueString(&buf, bufLen, "GPSDateStamp", ImageInfo.GpsDateStamp);
712 if (bufLen == 0) return NULL;
715 bufLen = addKeyValueString(&buf, bufLen, "GPSTimeStamp", ImageInfo.GpsTimeStamp);
716 if (bufLen == 0) return NULL;
719 bufLen = addKeyValueString(&buf, bufLen, "GPSProcessingMethod", ImageInfo.GpsProcessingMethod);
720 if (bufLen == 0) return NULL;
725 bufLen = addKeyValueString(&buf, bufLen, "UserComment", ImageInfo.Comments);
726 if (bufLen == 0) return NULL;