读取图片信息

因软件更新较快,部分文档内容与软件最新版本有所出入,请知悉。

读取图片的尺寸和Exif信息。


image.png


参数

图片来源】图片的来源类型,可选图片变量或图片文件。

【图片变量】来源为图片变量时,指定从哪个变量读取图片。

【文件路径】来源为图片路径时,指定从那个路径读取图片。


输出

【宽度】图片的宽度像素数。

【高度】图片的高度像素数。

【拍摄时间】从Exif数据中读取的照片拍摄时间。如果图片Exif中没有此信息,并且图片来源为文件时,读取文件的创建时间,否则返回一个特别小的时间(时间的最小值,1年1月1日0时)。

【Exif数据】返回一个词典类型的数据。键为经过转换后的Exif属性名称,值为转换为文本格式的Exif数据。


{
  "ImageDescription": "                               ",
  "EquipMake": "SONY",
  "EquipModel": "DSC-RX10M4",
  "Orientation": "1",
  "XResolution": "350/1",
  "YResolution": "350/1",
  "ResolutionUnit": "2",
  "SoftwareUsed": "DSC-RX10M4 v1.00",
  "DateTime": "2017:09:25 12:18:21",
  "YCbCrPositioning": "2",
  "ExifExposureTime": "1/250",
  "ExifFNumber": "40/10",
  "ExifExposureProg": "2",
  "ExifISOSpeed": "1250",
  "Exif_Photo_SensitivityType": "2",
  "Exif_Photo_RecommendedExposureIndex": "1250",
  "ExifVer": "825438768",
  "ExifDTOrig": "2017:09:25 12:18:21",
  "ExifDTDigitized": "2017:09:25 12:18:21",
  "36880": "+08:00",
  "36881": "+08:00",
  "36882": "+08:00",
  "ExifCompConfig": "197121",
  "ExifCompBPP": "2/1",
  "ExifBrightness": "11414/2560",
  "ExifExposureBias": "0/10",
  "ExifMaxAperture": "1024/256",
  "ExifMeteringMode": "5",
  "ExifLightSource": "0",
  "ExifFlash": "16",
  "ExifFocalLength": "22000/100",
  "ExifMakerNote": "....",
  "ExifUserComment": "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0",
  "ExifFPXVer": "808464688",
  "ExifColorSpace": "1",
  "ExifPixXDim": "5472",
  "ExifPixYDim": "3648",
  "20545": "R98",
  "20546": "808464688",
  "ExifFileSource": "",
  "ExifSceneType": "",
  "CustomRendered": "0",
  "ExposureMode": "0",
  "WhiteBalance": "0",
  "DigitalZoomRatio": "16/16",
  "FocalLengthIn35mmFilm": "600",
  "SceneCaptureType": "0",
  "Contrast": "0",
  "Saturation": "0",
  "Sharpness": "0",
  "Exif_Photo_LensSpecification": "880/100, 22000/100, 24/10, 40/10",
  "Exif_Image_PrintImageMatching": "1852404304, 5065076, 808465200, 131072, 65538, 16842752, 1",
  "ThumbnailData": "NOT_SUPPORTED",
  "ThumbnailCompression": "6",
  "ThumbnailImageDescription": "                               ",
  "ThumbnailEquipMake": "SONY",
  "ThumbnailEquipModel": "DSC-RX10M4",
  "ThumbnailOrientation": "1",
  "ThumbnailResolutionX": "72/1",
  "ThumbnailResolutionY": "72/1",
  "ThumbnailResolutionUnit": "2",
  "ThumbnailSoftwareUsed": "DSC-RX10M4 v1.00",
  "ThumbnailDateTime": "2017:09:25 12:18:21",
  "JPEGInterFormat": "34662",
  "JPEGInterLength": "5648",
  "ThumbnailYCbCrPositioning": "2",
  "ChrominanceTable": "2, 2, 2, 3, 6, 12, 15, 15, 2, 2, 2, 3, 6, 12, 15, 15, 2, 2, 2, 4, 7, 13, 15, 15, 3, 3, 4, 5, 9, 15, 15, 15, 6, 6, 7, 9, 14, 15, 15, 15, 12, 12, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15",
  "LuminanceTable": "1, 1, 1, 2, 2, 4, 5, 7, 1, 1, 2, 2, 3, 4, 5, 7, 1, 2, 2, 2, 3, 4, 6, 8, 2, 2, 2, 3, 3, 5, 6, 8, 2, 3, 3, 3, 4, 5, 7, 9, 4, 4, 4, 5, 5, 7, 8, 10, 5, 5, 6, 6, 7, 8, 10, 12, 7, 7, 8, 8, 9, 10, 12, 14"
}


【原始属性数据】返回一个C#词典对象,Key为Exif属性数字,Value为System.Drawing.Imaging.PropertyItem对象。



附加信息

【Exif数据中】所有支持的Exif属性名称(不支持的将直接返回属性数字值):


public enum ExifPropertyTypes
        {
            Exif_Image_ImageID = 0x800d,
            Exif_Image_CFARepeatPatternDim = 0x828d,
            Exif_Image_CFAPattern = 0x828e,
            Exif_Image_BatteryLevel = 0x828f,
            Copyright = 0x8298,
            ExifExposureTime = 0x829a,
            ExifFNumber = 0x829d,
            Exif_Image_IPTCNAA = 0x83bb,
            Exif_Image_ImageResources = 0x8649,
            ExifIFD = 0x8769,
            ICCProfile = 0x8773,
            ExifExposureProg = 0x8822,
            ExifSpectralSense = 0x8824,
            GpsIFD = 0x8825,
            ExifISOSpeed = 0x8827,
            ExifOECF = 0x8828,
            Exif_Image_Interlace = 0x8829,
            Exif_Image_TimeZoneOffset = 0x882a,
            Exif_Image_SelfTimerMode = 0x882b,
            Exif_Photo_SensitivityType = 0x8830,
            Exif_Photo_StandardOutputSensitivity = 0x8831,
            Exif_Photo_RecommendedExposureIndex = 0x8832,
            Exif_Photo_ISOSpeed = 0x8833,
            Exif_Photo_ISOSpeedLatitudeyyy = 0x8834,
            Exif_Photo_ISOSpeedLatitudezzz = 0x8835,
            ExifVer = 0x9000,
            ExifDTOrig = 0x9003,
            ExifDTDigitized = 0x9004,
            ExifCompConfig = 0x9101,
            ExifCompBPP = 0x9102,
            ExifShutterSpeed = 0x9201,
            ExifAperture = 0x9202,
            ExifBrightness = 0x9203,
            ExifExposureBias = 0x9204,
            ExifMaxAperture = 0x9205,
            ExifSubjectDist = 0x9206,
            ExifMeteringMode = 0x9207,
            ExifLightSource = 0x9208,
            ExifFlash = 0x9209,
            ExifFocalLength = 0x920a,
            Exif_Image_FlashEnergy = 0x920b,
            Exif_Image_SpatialFrequencyResponse = 0x920c,
            Exif_Image_Noise = 0x920d,
            Exif_Image_FocalPlaneXResolution = 0x920e,
            Exif_Image_FocalPlaneYResolution = 0x920f,
            Exif_Image_FocalPlaneResolutionUnit = 0x9210,
            Exif_Image_ImageNumber = 0x9211,
            Exif_Image_SecurityClassification = 0x9212,
            Exif_Image_ImageHistory = 0x9213,
            SubjectArea = 0x9214,
            Exif_Image_ExposureIndex = 0x9215,
            Exif_Image_TIFFEPStandardID = 0x9216,
            Exif_Image_SensingMethod = 0x9217,
            ExifMakerNote = 0x927c,
            ExifUserComment = 0x9286,
            ExifDTSubsec = 0x9290,
            ExifDTOrigSS = 0x9291,
            ExifDTDigSS = 0x9292,
            Exif_Image_XPTitle = 0x9c9b,
            Exif_Image_XPComment = 0x9c9c,
            Exif_Image_XPAuthor = 0x9c9d,
            Exif_Image_XPKeywords = 0x9c9e,
            Exif_Image_XPSubject = 0x9c9f,
            ExifFPXVer = 0xa000,
            ExifColorSpace = 0xa001,
            ExifPixXDim = 0xa002,
            ExifPixYDim = 0xa003,
            ExifRelatedWav = 0xa004,
            ExifInterop = 0xa005,
            ExifFlashEnergy = 0xa20b,
            ExifSpatialFR = 0xa20c,
            ExifFocalXRes = 0xa20e,
            ExifFocalYRes = 0xa20f,
            ExifFocalResUnit = 0xa210,
            ExifSubjectLoc = 0xa214,
            ExifExposureIndex = 0xa215,
            ExifSensingMethod = 0xa217,
            ExifFileSource = 0xa300,
            ExifSceneType = 0xa301,
            ExifCfaPattern = 0xa302,
            CustomRendered = 0xa401,
            ExposureMode = 0xa402,
            WhiteBalance = 0xa403,
            DigitalZoomRatio = 0xa404,
            FocalLengthIn35mmFilm = 0xa405,
            SceneCaptureType = 0xa406,
            GainControl = 0xa407,
            Contrast = 0xa408,
            Saturation = 0xa409,
            Sharpness = 0xa40a,
            DeviceSettingDescription = 0xa40b,
            SubjectDistanceRange = 0xa40c,
            ImageUniqueID = 0xa420,
            Exif_Photo_CameraOwnerName = 0xa430,
            Exif_Photo_BodySerialNumber = 0xa431,
            Exif_Photo_LensSpecification = 0xa432,
            Exif_Photo_LensMake = 0xa433,
            Exif_Photo_LensModel = 0xa434,
            Exif_Photo_LensSerialNumber = 0xa435,
            Exif_Image_PrintImageMatching = 0xc4a5,
            Exif_Image_DNGVersion = 0xc612,
            Exif_Image_DNGBackwardVersion = 0xc613,
            Exif_Image_UniqueCameraModel = 0xc614,
            Exif_Image_LocalizedCameraModel = 0xc615,
            Exif_Image_CFAPlaneColor = 0xc616,
            Exif_Image_CFALayout = 0xc617,
            Exif_Image_LinearizationTable = 0xc618,
            Exif_Image_BlackLevelRepeatDim = 0xc619,
            Exif_Image_BlackLevel = 0xc61a,
            Exif_Image_BlackLevelDeltaH = 0xc61b,
            Exif_Image_BlackLevelDeltaV = 0xc61c,
            Exif_Image_WhiteLevel = 0xc61d,
            Exif_Image_DefaultScale = 0xc61e,
            Exif_Image_DefaultCropOrigin = 0xc61f,
            Exif_Image_DefaultCropSize = 0xc620,
            Exif_Image_ColorMatrix1 = 0xc621,
            Exif_Image_ColorMatrix2 = 0xc622,
            Exif_Image_CameraCalibration1 = 0xc623,
            Exif_Image_CameraCalibration2 = 0xc624,
            Exif_Image_ReductionMatrix1 = 0xc625,
            Exif_Image_ReductionMatrix2 = 0xc626,
            Exif_Image_AnalogBalance = 0xc627,
            Exif_Image_AsShotNeutral = 0xc628,
            Exif_Image_AsShotWhiteXY = 0xc629,
            Exif_Image_BaselineExposure = 0xc62a,
            Exif_Image_BaselineNoise = 0xc62b,
            Exif_Image_BaselineSharpness = 0xc62c,
            Exif_Image_BayerGreenSplit = 0xc62d,
            Exif_Image_LinearResponseLimit = 0xc62e,
            Exif_Image_CameraSerialNumber = 0xc62f,
            Exif_Image_LensInfo = 0xc630,
            Exif_Image_ChromaBlurRadius = 0xc631,
            Exif_Image_AntiAliasStrength = 0xc632,
            Exif_Image_ShadowScale = 0xc633,
            Exif_Image_DNGPrivateData = 0xc634,
            Exif_Image_MakerNoteSafety = 0xc635,
            Exif_Image_CalibrationIlluminant1 = 0xc65a,
            Exif_Image_CalibrationIlluminant2 = 0xc65b,
            Exif_Image_BestQualityScale = 0xc65c,
            Exif_Image_RawDataUniqueID = 0xc65d,
            Exif_Image_OriginalRawFileName = 0xc68b,
            Exif_Image_OriginalRawFileData = 0xc68c,
            Exif_Image_ActiveArea = 0xc68d,
            Exif_Image_MaskedAreas = 0xc68e,
            Exif_Image_AsShotICCProfile = 0xc68f,
            Exif_Image_AsShotPreProfileMatrix = 0xc690,
            Exif_Image_CurrentICCProfile = 0xc691,
            Exif_Image_CurrentPreProfileMatrix = 0xc692,
            Exif_Image_ColorimetricReference = 0xc6bf,
            Exif_Image_CameraCalibrationSignature = 0xc6f3,
            Exif_Image_ProfileCalibrationSignature = 0xc6f4,
            Exif_Image_AsShotProfileName = 0xc6f6,
            Exif_Image_NoiseReductionApplied = 0xc6f7,
            Exif_Image_ProfileName = 0xc6f8,
            Exif_Image_ProfileHueSatMapDims = 0xc6f9,
            Exif_Image_ProfileHueSatMapData1 = 0xc6fa,
            Exif_Image_ProfileHueSatMapData2 = 0xc6fb,
            Exif_Image_ProfileToneCurve = 0xc6fc,
            Exif_Image_ProfileEmbedPolicy = 0xc6fd,
            Exif_Image_ProfileCopyright = 0xc6fe,
            Exif_Image_ForwardMatrix1 = 0xc714,
            Exif_Image_ForwardMatrix2 = 0xc715,
            Exif_Image_PreviewApplicationName = 0xc716,
            Exif_Image_PreviewApplicationVersion = 0xc717,
            Exif_Image_PreviewSettingsName = 0xc718,
            Exif_Image_PreviewSettingsDigest = 0xc719,
            Exif_Image_PreviewColorSpace = 0xc71a,
            Exif_Image_PreviewDateTime = 0xc71b,
            Exif_Image_RawImageDigest = 0xc71c,
            Exif_Image_OriginalRawFileDigest = 0xc71d,
            Exif_Image_SubTileBlockSize = 0xc71e,
            Exif_Image_RowInterleaveFactor = 0xc71f,
            Exif_Image_ProfileLookTableDims = 0xc725,
            Exif_Image_ProfileLookTableData = 0xc726,
            Exif_Image_OpcodeList1 = 0xc740,
            Exif_Image_OpcodeList2 = 0xc741,
            Exif_Image_OpcodeList3 = 0xc74e,
            Exif_Image_NoiseProfile = 0xc761,
            GpsVer = 0x0000,
            GpsLatitudeRef = 0x0001,
            GpsLatitude = 0x0002,
            GpsLongitudeRef = 0x0003,
            GpsLongitude = 0x0004,
            GpsAltitudeRef = 0x0005,
            GpsAltitude = 0x0006,
            GpsGpsTime = 0x0007,
            GpsGpsSatellites = 0x0008,
            GpsGpsStatus = 0x0009,
            GpsGpsMeasureMode = 0x000a,
            GpsGpsDop = 0x000b,
            GpsSpeedRef = 0x000c,
            GpsSpeed = 0x000d,
            GpsTrackRef = 0x000e,
            GpsTrack = 0x000f,
            GpsImgDirRef = 0x0010,
            GpsImgDir = 0x0011,
            GpsMapDatum = 0x0012,
            GpsDestLatRef = 0x0013,
            GpsDestLat = 0x0014,
            GpsDestLongRef = 0x0015,
            GpsDestLong = 0x0016,
            GpsDestBearRef = 0x0017,
            GpsDestBear = 0x0018,
            GpsDestDistRef = 0x0019,
            GpsDestDist = 0x001a,
            Exif_GPSInfo_GPSProcessingMethod = 0x001b,
            Exif_GPSInfo_GPSAreaInformation = 0x001c,
            Exif_GPSInfo_GPSDateStamp = 0x001d,
            Exif_GPSInfo_GPSDifferential = 0x001e,
            NewSubfileType = 0x00fe,
            SubfileType = 0x00ff,
            ImageWidth = 0x0100,
            ImageHeight = 0x0101,
            BitsPerSample = 0x0102,
            Compression = 0x0103,
            PhotometricInterp = 0x0106,
            ThreshHolding = 0x0107,
            CellWidth = 0x0108,
            CellHeight = 0x0109,
            FillOrder = 0x010a,
            DocumentName = 0x010d,
            ImageDescription = 0x010e,
            EquipMake = 0x010f,
            EquipModel = 0x0110,
            StripOffsets = 0x0111,
            Orientation = 0x0112,
            SamplesPerPixel = 0x0115,
            RowsPerStrip = 0x0116,
            StripBytesCount = 0x0117,
            MinSampleValue = 0x0118,
            MaxSampleValue = 0x0119,
            XResolution = 0x011a,
            YResolution = 0x011b,
            PlanarConfig = 0x011c,
            PageName = 0x011d,
            XPosition = 0x011e,
            YPosition = 0x011f,
            FreeOffset = 0x0120,
            FreeByteCounts = 0x0121,
            GrayResponseUnit = 0x0122,
            GrayResponseCurve = 0x0123,
            T4Option = 0x0124,
            T6Option = 0x0125,
            ResolutionUnit = 0x0128,
            PageNumber = 0x0129,
            TransferFunction = 0x012d,
            SoftwareUsed = 0x0131,
            DateTime = 0x0132,
            Artist = 0x013b,
            HostComputer = 0x013c,
            Predictor = 0x013d,
            WhitePoint = 0x013e,
            PrimaryChromaticities = 0x013f,
            ColorMap = 0x0140,
            HalftoneHints = 0x0141,
            TileWidth = 0x0142,
            TileLength = 0x0143,
            TileOffset = 0x0144,
            TileByteCounts = 0x0145,
            Exif_Image_SubIFDs = 0x014a,
            InkSet = 0x014c,
            InkNames = 0x014d,
            NumberOfInks = 0x014e,
            DotRange = 0x0150,
            TargetPrinter = 0x0151,
            ExtraSamples = 0x0152,
            SampleFormat = 0x0153,
            SMinSampleValue = 0x0154,
            SMaxSampleValue = 0x0155,
            TransferRange = 0x0156,
            Exif_Image_ClipPath = 0x0157,
            Exif_Image_XClipPathUnits = 0x0158,
            Exif_Image_YClipPathUnits = 0x0159,
            Exif_Image_Indexed = 0x015a,
            Exif_Image_JPEGTables = 0x015b,
            Exif_Image_OPIProxy = 0x015f,
            JPEGProc = 0x0200,
            JPEGInterFormat = 0x0201,
            JPEGInterLength = 0x0202,
            JPEGRestartInterval = 0x0203,
            JPEGLosslessPredictors = 0x0205,
            JPEGPointTransforms = 0x0206,
            JPEGQTables = 0x0207,
            JPEGDCTables = 0x0208,
            JPEGACTables = 0x0209,
            YCbCrCoefficients = 0x0211,
            YCbCrSubsampling = 0x0212,
            YCbCrPositioning = 0x0213,
            REFBlackWhite = 0x0214,
            Exif_Image_XMLPacket = 0x02bc,
            Gamma = 0x0301,
            ICCProfileDescriptor = 0x0302,
            SRGBRenderingIntent = 0x0303,
            ImageTitle = 0x0320,
            Exif_Iop_RelatedImageFileFormat = 0x1000,
            Exif_Iop_RelatedImageWidth = 0x1001,
            Exif_Iop_RelatedImageLength = 0x1002,
            Exif_Image_Rating = 0x4746,
            Exif_Image_RatingPercent = 0x4749,
            ResolutionXUnit = 0x5001,
            ResolutionYUnit = 0x5002,
            ResolutionXLengthUnit = 0x5003,
            ResolutionYLengthUnit = 0x5004,
            PrintFlags = 0x5005,
            PrintFlagsVersion = 0x5006,
            PrintFlagsCrop = 0x5007,
            PrintFlagsBleedWidth = 0x5008,
            PrintFlagsBleedWidthScale = 0x5009,
            HalftoneLPI = 0x500a,
            HalftoneLPIUnit = 0x500b,
            HalftoneDegree = 0x500c,
            HalftoneShape = 0x500d,
            HalftoneMisc = 0x500e,
            HalftoneScreen = 0x500f,
            JPEGQuality = 0x5010,
            GridSize = 0x5011,
            ThumbnailFormat = 0x5012,
            ThumbnailWidth = 0x5013,
            ThumbnailHeight = 0x5014,
            ThumbnailColorDepth = 0x5015,
            ThumbnailPlanes = 0x5016,
            ThumbnailRawBytes = 0x5017,
            ThumbnailSize = 0x5018,
            ThumbnailCompressedSize = 0x5019,
            ColorTransferFunction = 0x501a,
            ThumbnailData = 0x501b,
            ThumbnailImageWidth = 0x5020,
            ThumbnailImageHeight = 0x5021,
            ThumbnailBitsPerSample = 0x5022,
            ThumbnailCompression = 0x5023,
            ThumbnailPhotometricInterp = 0x5024,
            ThumbnailImageDescription = 0x5025,
            ThumbnailEquipMake = 0x5026,
            ThumbnailEquipModel = 0x5027,
            ThumbnailStripOffsets = 0x5028,
            ThumbnailOrientation = 0x5029,
            ThumbnailSamplesPerPixel = 0x502a,
            ThumbnailRowsPerStrip = 0x502b,
            ThumbnailStripBytesCount = 0x502c,
            ThumbnailResolutionX = 0x502d,
            ThumbnailResolutionY = 0x502e,
            ThumbnailPlanarConfig = 0x502f,
            ThumbnailResolutionUnit = 0x5030,
            ThumbnailTransferFunction = 0x5031,
            ThumbnailSoftwareUsed = 0x5032,
            ThumbnailDateTime = 0x5033,
            ThumbnailArtist = 0x5034,
            ThumbnailWhitePoint = 0x5035,
            ThumbnailPrimaryChromaticities = 0x5036,
            ThumbnailYCbCrCoefficients = 0x5037,
            ThumbnailYCbCrSubsampling = 0x5038,
            ThumbnailYCbCrPositioning = 0x5039,
            ThumbnailRefBlackWhite = 0x503a,
            ThumbnailCopyRight = 0x503b,
            LuminanceTable = 0x5090,
            ChrominanceTable = 0x5091,
            FrameDelay = 0x5100,
            LoopCount = 0x5101,
            GlobalPalette = 0x5102,
            IndexBackground = 0x5103,
            IndexTransparent = 0x5104,
            PixelUnit = 0x5110,
            PixelPerUnitX = 0x5111,
            PixelPerUnitY = 0x5112,
            PaletteHistogram = 0x5113,
        }


更改历史

  • 1.4.7 版本:开始提供。

反馈与讨论

使用问题 · 245
blanka 2024-05-09 18:30 blanka 2024-05-09 20:55
使用问题 · 383
yangk 2023-10-27 23:19 CL 2023-10-28 08:46
语雀在语雀上查看