public virtual string GetGpsDirectionDescription(int tagType) { Rational angle = _directory.GetRational(tagType); // provide a decimal version of rational numbers in the description, to avoid strings like "35334/199 degrees" string value = angle != null ? new DecimalFormat("0.##").Format(angle.DoubleValue()) : _directory.GetString(tagType); return(value == null || Sharpen.Extensions.Trim(value).Length == 0 ? null : Sharpen.Extensions.Trim(value) + " degrees"); }
protected internal virtual string GetDecimalRational(int tagType, int decimalPlaces) { Rational value = _directory.GetRational(tagType); if (value == null) { return null; } return Sharpen.Extensions.StringFormat("%." + decimalPlaces + "f", value.DoubleValue()); }
public virtual string GetFNumberDescription() { Rational value = _directory.GetRational(XmpDirectory.TagFNumber); if (value == null) { return(null); } return("F" + SimpleDecimalFormatter.Format(value.DoubleValue())); }
public virtual string GetFocalLengthDescription() { Rational value = _directory.GetRational(XmpDirectory.TagFocalLength); if (value == null) { return(null); } DecimalFormat formatter = new DecimalFormat("0.0##"); return(formatter.Format(value.DoubleValue()) + " mm"); }
public virtual string GetSubjectDistanceDescription() { Rational value = _directory.GetRational(ExifSubIFDDirectory.TagSubjectDistance); if (value == null) { return(null); } DecimalFormat formatter = new DecimalFormat("0.0##"); return(formatter.Format(value.DoubleValue()) + " metres"); }
public virtual string GetDigitalZoomRatioDescription() { Rational value = _directory.GetRational(ExifSubIFDDirectory.TagDigitalZoomRatio); return(value == null ? null : value.GetNumerator() == 0 ? "Digital zoom not used." : SimpleDecimalFormatter.Format(value.DoubleValue())); }