Exemplo n.º 1
0
        private static Exif GetExifFromImage(Image image)
        {
            Exif ans = new Exif();

            Parallel.ForEach(image.PropertyItems, Constants.ParallelOptions,
                current =>
                {
                    var previousPriority = Thread.CurrentThread.Priority;
                    Thread.CurrentThread.Priority = ThreadPriority.Lowest;

                    if (Constants.ExifData.ContainsKey(current.Id))
                    {
                        ans.SetValue(Constants.ExifData[current.Id], current.Value);
                    }

                    //Reset previous priority of the TPL Thread
                    Thread.CurrentThread.Priority = previousPriority;
                });

            ans.HasBeenSet = true;

            return ans;
        }
Exemplo n.º 2
0
        public bool Equals(Exif other)
        {
            if (HasBeenSet == false && HasBeenSet == other.HasBeenSet)
                return true;

            if (PropertyTagGpsVer != other.PropertyTagGpsVer ||
                PropertyTagGpsLatitudeRef != other.PropertyTagGpsLatitudeRef ||
                PropertyTagGpsLatitude != other.PropertyTagGpsLatitude ||
                PropertyTagGpsLongitudeRef != other.PropertyTagGpsLongitudeRef ||
                PropertyTagGpsLongitude != other.PropertyTagGpsLongitude ||
                PropertyTagGpsAltitudeRef != other.PropertyTagGpsAltitudeRef ||
                PropertyTagGpsAltitude != other.PropertyTagGpsAltitude ||
                PropertyTagGpsGpsTime != other.PropertyTagGpsGpsTime ||
                PropertyTagGpsGpsSatellites != other.PropertyTagGpsGpsSatellites ||
                PropertyTagGpsGpsStatus != other.PropertyTagGpsGpsStatus ||
                PropertyTagGpsGpsMeasureMode != other.PropertyTagGpsGpsMeasureMode ||
                PropertyTagGpsGpsDop != other.PropertyTagGpsGpsDop ||
                PropertyTagGpsSpeedRef != other.PropertyTagGpsSpeedRef ||
                PropertyTagGpsSpeed != other.PropertyTagGpsSpeed ||
                PropertyTagGpsTrackRef != other.PropertyTagGpsTrackRef ||
                PropertyTagGpsTrack != other.PropertyTagGpsTrack ||
                PropertyTagGpsImgDirRef != other.PropertyTagGpsImgDirRef ||
                PropertyTagGpsImgDir != other.PropertyTagGpsImgDir ||
                PropertyTagGpsMapDatum != other.PropertyTagGpsMapDatum ||
                PropertyTagGpsDestLatRef != other.PropertyTagGpsDestLatRef ||
                PropertyTagGpsDestLat != other.PropertyTagGpsDestLat ||
                PropertyTagGpsDestLongRef != other.PropertyTagGpsDestLongRef ||
                PropertyTagGpsDestLong != other.PropertyTagGpsDestLong ||
                PropertyTagGpsDestBearRef != other.PropertyTagGpsDestBearRef ||
                PropertyTagGpsDestBear != other.PropertyTagGpsDestBear ||
                PropertyTagGpsDestDistRef != other.PropertyTagGpsDestDistRef ||
                PropertyTagGpsDestDist != other.PropertyTagGpsDestDist ||
                PropertyTagNewSubfileType != other.PropertyTagNewSubfileType ||
                PropertyTagSubfileType != other.PropertyTagSubfileType ||
                PropertyTagImageWidth != other.PropertyTagImageWidth ||
                PropertyTagImageHeight != other.PropertyTagImageHeight ||
                PropertyTagBitsPerSample != other.PropertyTagBitsPerSample ||
                PropertyTagCompression != other.PropertyTagCompression ||
                PropertyTagPhotometricInterp != other.PropertyTagPhotometricInterp ||
                PropertyTagThreshHolding != other.PropertyTagThreshHolding ||
                PropertyTagCellWidth != other.PropertyTagCellWidth ||
                PropertyTagCellHeight != other.PropertyTagCellHeight ||
                PropertyTagFillOrder != other.PropertyTagFillOrder ||
                PropertyTagDocumentName != other.PropertyTagDocumentName ||
                PropertyTagImageDescription != other.PropertyTagImageDescription ||
                PropertyTagEquipMake != other.PropertyTagEquipMake ||
                PropertyTagEquipModel != other.PropertyTagEquipModel ||
                PropertyTagStripOffsets != other.PropertyTagStripOffsets ||
                PropertyTagOrientation != other.PropertyTagOrientation ||
                PropertyTagSamplesPerPixel != other.PropertyTagSamplesPerPixel ||
                PropertyTagRowsPerStrip != other.PropertyTagRowsPerStrip ||
                PropertyTagStripBytesCount != other.PropertyTagStripBytesCount ||
                PropertyTagMinSampleValue != other.PropertyTagMinSampleValue ||
                PropertyTagMaxSampleValue != other.PropertyTagMaxSampleValue ||
                PropertyTagXResolution != other.PropertyTagXResolution ||
                PropertyTagYResolution != other.PropertyTagYResolution ||
                PropertyTagPlanarConfig != other.PropertyTagPlanarConfig ||
                PropertyTagPageName != other.PropertyTagPageName ||
                PropertyTagXPosition != other.PropertyTagXPosition ||
                PropertyTagYPosition != other.PropertyTagYPosition ||
                PropertyTagFreeOffset != other.PropertyTagFreeOffset ||
                PropertyTagFreeByteCounts != other.PropertyTagFreeByteCounts ||
                PropertyTagGrayResponseUnit != other.PropertyTagGrayResponseUnit ||
                PropertyTagGrayResponseCurve != other.PropertyTagGrayResponseCurve ||
                PropertyTagT4Option != other.PropertyTagT4Option ||
                PropertyTagT6Option != other.PropertyTagT6Option ||
                PropertyTagResolutionUnit != other.PropertyTagResolutionUnit ||
                PropertyTagPageNumber != other.PropertyTagPageNumber ||
                PropertyTagTransferFunction != other.PropertyTagTransferFunction ||
                PropertyTagSoftwareUsed != other.PropertyTagSoftwareUsed ||
                PropertyTagDateTime != other.PropertyTagDateTime ||
                PropertyTagArtist != other.PropertyTagArtist ||
                PropertyTagHostComputer != other.PropertyTagHostComputer ||
                PropertyTagPredictor != other.PropertyTagPredictor ||
                PropertyTagWhitePoint != other.PropertyTagWhitePoint ||
                PropertyTagPrimaryChromaticities != other.PropertyTagPrimaryChromaticities ||
                PropertyTagColorMap != other.PropertyTagColorMap ||
                PropertyTagHalftoneHints != other.PropertyTagHalftoneHints ||
                PropertyTagTileWidth != other.PropertyTagTileWidth ||
                PropertyTagTileLength != other.PropertyTagTileLength ||
                PropertyTagTileOffset != other.PropertyTagTileOffset ||
                PropertyTagTileByteCounts != other.PropertyTagTileByteCounts ||
                PropertyTagInkSet != other.PropertyTagInkSet ||
                PropertyTagInkNames != other.PropertyTagInkNames ||
                PropertyTagNumberOfInks != other.PropertyTagNumberOfInks ||
                PropertyTagDotRange != other.PropertyTagDotRange ||
                PropertyTagTargetPrinter != other.PropertyTagTargetPrinter ||
                PropertyTagExtraSamples != other.PropertyTagExtraSamples ||
                PropertyTagSampleFormat != other.PropertyTagSampleFormat ||
                PropertyTagSMinSampleValue != other.PropertyTagSMinSampleValue ||
                PropertyTagSMaxSampleValue != other.PropertyTagSMaxSampleValue ||
                PropertyTagTransferRange != other.PropertyTagTransferRange ||
                PropertyTagJPEGProc != other.PropertyTagJPEGProc ||
                PropertyTagJPEGInterFormat != other.PropertyTagJPEGInterFormat ||
                PropertyTagJPEGInterLength != other.PropertyTagJPEGInterLength ||
                PropertyTagJPEGRestartInterval != other.PropertyTagJPEGRestartInterval ||
                PropertyTagJPEGLosslessPredictors != other.PropertyTagJPEGLosslessPredictors ||
                PropertyTagJPEGPointTransforms != other.PropertyTagJPEGPointTransforms ||
                PropertyTagJPEGQTables != other.PropertyTagJPEGQTables ||
                PropertyTagJPEGDCTables != other.PropertyTagJPEGDCTables ||
                PropertyTagJPEGACTables != other.PropertyTagJPEGACTables ||
                PropertyTagYCbCrCoefficients != other.PropertyTagYCbCrCoefficients ||
                PropertyTagYCbCrSubsampling != other.PropertyTagYCbCrSubsampling ||
                PropertyTagYCbCrPositioning != other.PropertyTagYCbCrPositioning ||
                PropertyTagREFBlackWhite != other.PropertyTagREFBlackWhite ||
                PropertyTagGamma != other.PropertyTagGamma ||
                PropertyTagICCProfileDescriptor != other.PropertyTagICCProfileDescriptor ||
                PropertyTagSRGBRenderingIntent != other.PropertyTagSRGBRenderingIntent ||
                PropertyTagImageTitle != other.PropertyTagImageTitle ||
                PropertyTagResolutionXUnit != other.PropertyTagResolutionXUnit ||
                PropertyTagResolutionYUnit != other.PropertyTagResolutionYUnit ||
                PropertyTagResolutionXLengthUnit != other.PropertyTagResolutionXLengthUnit ||
                PropertyTagResolutionYLengthUnit != other.PropertyTagResolutionYLengthUnit ||
                PropertyTagPrintFlags != other.PropertyTagPrintFlags ||
                PropertyTagPrintFlagsVersion != other.PropertyTagPrintFlagsVersion ||
                PropertyTagPrintFlagsCrop != other.PropertyTagPrintFlagsCrop ||
                PropertyTagPrintFlagsBleedWidth != other.PropertyTagPrintFlagsBleedWidth ||
                PropertyTagPrintFlagsBleedWidthScale != other.PropertyTagPrintFlagsBleedWidthScale ||
                PropertyTagHalftoneLPI != other.PropertyTagHalftoneLPI ||
                PropertyTagHalftoneLPIUnit != other.PropertyTagHalftoneLPIUnit ||
                PropertyTagHalftoneDegree != other.PropertyTagHalftoneDegree ||
                PropertyTagHalftoneShape != other.PropertyTagHalftoneShape ||
                PropertyTagHalftoneMisc != other.PropertyTagHalftoneMisc ||
                PropertyTagHalftoneScreen != other.PropertyTagHalftoneScreen ||
                PropertyTagJPEGQuality != other.PropertyTagJPEGQuality ||
                PropertyTagGridSize != other.PropertyTagGridSize ||
                PropertyTagThumbnailFormat != other.PropertyTagThumbnailFormat ||
                PropertyTagThumbnailWidth != other.PropertyTagThumbnailWidth ||
                PropertyTagThumbnailHeight != other.PropertyTagThumbnailHeight ||
                PropertyTagThumbnailColorDepth != other.PropertyTagThumbnailColorDepth ||
                PropertyTagThumbnailPlanes != other.PropertyTagThumbnailPlanes ||
                PropertyTagThumbnailRawBytes != other.PropertyTagThumbnailRawBytes ||
                PropertyTagThumbnailSize != other.PropertyTagThumbnailSize ||
                PropertyTagThumbnailCompressedSize != other.PropertyTagThumbnailCompressedSize ||
                PropertyTagColorTransferFunction != other.PropertyTagColorTransferFunction ||
                PropertyTagThumbnailData != other.PropertyTagThumbnailData ||
                PropertyTagThumbnailImageWidth != other.PropertyTagThumbnailImageWidth ||
                PropertyTagThumbnailImageHeight != other.PropertyTagThumbnailImageHeight ||
                PropertyTagThumbnailBitsPerSample != other.PropertyTagThumbnailBitsPerSample ||
                PropertyTagThumbnailCompression != other.PropertyTagThumbnailCompression ||
                PropertyTagThumbnailPhotometricInterp != other.PropertyTagThumbnailPhotometricInterp ||
                PropertyTagThumbnailImageDescription != other.PropertyTagThumbnailImageDescription ||
                PropertyTagThumbnailEquipMake != other.PropertyTagThumbnailEquipMake ||
                PropertyTagThumbnailEquipModel != other.PropertyTagThumbnailEquipModel ||
                PropertyTagThumbnailStripOffsets != other.PropertyTagThumbnailStripOffsets ||
                PropertyTagThumbnailOrientation != other.PropertyTagThumbnailOrientation ||
                PropertyTagThumbnailSamplesPerPixel != other.PropertyTagThumbnailSamplesPerPixel ||
                PropertyTagThumbnailRowsPerStrip != other.PropertyTagThumbnailRowsPerStrip ||
                PropertyTagThumbnailStripBytesCount != other.PropertyTagThumbnailStripBytesCount ||
                PropertyTagThumbnailResolutionX != other.PropertyTagThumbnailResolutionX ||
                PropertyTagThumbnailResolutionY != other.PropertyTagThumbnailResolutionY ||
                PropertyTagThumbnailPlanarConfig != other.PropertyTagThumbnailPlanarConfig ||
                PropertyTagThumbnailResolutionUnit != other.PropertyTagThumbnailResolutionUnit ||
                PropertyTagThumbnailTransferFunction != other.PropertyTagThumbnailTransferFunction ||
                PropertyTagThumbnailSoftwareUsed != other.PropertyTagThumbnailSoftwareUsed ||
                PropertyTagThumbnailDateTime != other.PropertyTagThumbnailDateTime ||
                PropertyTagThumbnailArtist != other.PropertyTagThumbnailArtist ||
                PropertyTagThumbnailWhitePoint != other.PropertyTagThumbnailWhitePoint ||
                PropertyTagThumbnailPrimaryChromaticities != other.PropertyTagThumbnailPrimaryChromaticities ||
                PropertyTagThumbnailYCbCrCoefficients != other.PropertyTagThumbnailYCbCrCoefficients ||
                PropertyTagThumbnailYCbCrSubsampling != other.PropertyTagThumbnailYCbCrSubsampling ||
                PropertyTagThumbnailYCbCrPositioning != other.PropertyTagThumbnailYCbCrPositioning ||
                PropertyTagThumbnailRefBlackWhite != other.PropertyTagThumbnailRefBlackWhite ||
                PropertyTagThumbnailCopyRight != other.PropertyTagThumbnailCopyRight ||
                PropertyTagLuminanceTable != other.PropertyTagLuminanceTable ||
                PropertyTagChrominanceTable != other.PropertyTagChrominanceTable ||
                PropertyTagFrameDelay != other.PropertyTagFrameDelay ||
                PropertyTagLoopCount != other.PropertyTagLoopCount ||
                PropertyTagGlobalPalette != other.PropertyTagGlobalPalette ||
                PropertyTagIndexBackground != other.PropertyTagIndexBackground ||
                PropertyTagIndexTransparent != other.PropertyTagIndexTransparent ||
                PropertyTagPixelUnit != other.PropertyTagPixelUnit ||
                PropertyTagPixelPerUnitX != other.PropertyTagPixelPerUnitX ||
                PropertyTagPixelPerUnitY != other.PropertyTagPixelPerUnitY ||
                PropertyTagPaletteHistogram != other.PropertyTagPaletteHistogram ||
                PropertyTagCopyright != other.PropertyTagCopyright ||
                PropertyTagExifExposureTime != other.PropertyTagExifExposureTime ||
                PropertyTagExifFNumber != other.PropertyTagExifFNumber ||
                PropertyTagExifIFD != other.PropertyTagExifIFD ||
                PropertyTagICCProfile != other.PropertyTagICCProfile ||
                PropertyTagExifExposureProg != other.PropertyTagExifExposureProg ||
                PropertyTagExifSpectralSense != other.PropertyTagExifSpectralSense ||
                PropertyTagGpsIFD != other.PropertyTagGpsIFD ||
                PropertyTagExifISOSpeed != other.PropertyTagExifISOSpeed ||
                PropertyTagExifOECF != other.PropertyTagExifOECF ||
                PropertyTagExifVer != other.PropertyTagExifVer ||
                PropertyTagExifDTOrig != other.PropertyTagExifDTOrig ||
                PropertyTagExifDTDigitized != other.PropertyTagExifDTDigitized ||
                PropertyTagExifCompConfig != other.PropertyTagExifCompConfig ||
                PropertyTagExifCompBPP != other.PropertyTagExifCompBPP ||
                PropertyTagExifShutterSpeed != other.PropertyTagExifShutterSpeed ||
                PropertyTagExifAperture != other.PropertyTagExifAperture ||
                PropertyTagExifBrightness != other.PropertyTagExifBrightness ||
                PropertyTagExifExposureBias != other.PropertyTagExifExposureBias ||
                PropertyTagExifMaxAperture != other.PropertyTagExifMaxAperture ||
                PropertyTagExifSubjectDist != other.PropertyTagExifSubjectDist ||
                PropertyTagExifMeteringMode != other.PropertyTagExifMeteringMode ||
                PropertyTagExifLightSource != other.PropertyTagExifLightSource ||
                PropertyTagExifFlash != other.PropertyTagExifFlash ||
                PropertyTagExifFocalLength != other.PropertyTagExifFocalLength ||
                PropertyTagExifMakerNote != other.PropertyTagExifMakerNote ||
                PropertyTagExifUserComment != other.PropertyTagExifUserComment ||
                PropertyTagExifDTSubsec != other.PropertyTagExifDTSubsec ||
                PropertyTagExifDTOrigSS != other.PropertyTagExifDTOrigSS ||
                PropertyTagExifDTDigSS != other.PropertyTagExifDTDigSS ||
                PropertyTagExifFPXVer != other.PropertyTagExifFPXVer ||
                PropertyTagExifColorSpace != other.PropertyTagExifColorSpace ||
                PropertyTagExifPixXDim != other.PropertyTagExifPixXDim ||
                PropertyTagExifPixYDim != other.PropertyTagExifPixYDim ||
                PropertyTagExifRelatedWav != other.PropertyTagExifRelatedWav ||
                PropertyTagExifInterop != other.PropertyTagExifInterop ||
                PropertyTagExifFlashEnergy != other.PropertyTagExifFlashEnergy ||
                PropertyTagExifSpatialFR != other.PropertyTagExifSpatialFR ||
                PropertyTagExifFocalXRes != other.PropertyTagExifFocalXRes ||
                PropertyTagExifFocalYRes != other.PropertyTagExifFocalYRes ||
                PropertyTagExifFocalResUnit != other.PropertyTagExifFocalResUnit ||
                PropertyTagExifSubjectLoc != other.PropertyTagExifSubjectLoc ||
                PropertyTagExifExposureIndex != other.PropertyTagExifExposureIndex ||
                PropertyTagExifSensingMethod != other.PropertyTagExifSensingMethod ||
                PropertyTagExifFileSource != other.PropertyTagExifFileSource ||
                PropertyTagExifSceneType != other.PropertyTagExifSceneType ||
                PropertyTagExifCfaPattern != other.PropertyTagExifCfaPattern)
                return false;

            return true;
        }