Ejemplo n.º 1
0
    public FSpot.Iptc.IptcFile GetIptc()
    {
        string name = PhotoshopSignature.Name;

        JpegHeader.Marker marker = FindMarker(PhotoshopSignature);
        if (marker != null)
        {
            int len = name.Length;
            using (System.IO.Stream bimstream = new System.IO.MemoryStream(marker.Data, len,
                                                                           marker.Data.Length - len, false)) {
                FSpot.Bim.BimFile bim;
                try {
                    bim = new FSpot.Bim.BimFile(bimstream);
                } catch {
                    // Bim entry with marker "PHUT" is not handled by Bim.cs
                    return(null);
                }

                // FIXME: What about EntryType.XMP ?
                FSpot.Bim.Entry iptc_entry = bim.FindEntry(FSpot.Bim.EntryType.IPTCNAA);
                if (iptc_entry == null)
                {
                    return(null);
                }

                using (System.IO.Stream iptcstream = new System.IO.MemoryStream(iptc_entry.Data)) {
                    FSpot.Iptc.IptcFile iptc = new FSpot.Iptc.IptcFile(iptcstream);
                    return(iptc);
                }
            }
        }
        return(null);
    }
Ejemplo n.º 2
0
    public void Select(SemWeb.StatementSink sink)
    {
        FSpot.Tiff.Header exif = GetExifHeader();
        if (exif != null)
        {
            exif.Select(sink);
        }

        XmpFile xmp = GetXmp();

        if (xmp != null)
        {
            xmp.Select(sink);
        }

        string name = PhotoshopSignature.Name;

        JpegHeader.Marker marker = FindMarker(PhotoshopSignature);
        if (marker != null)
        {
            int len = name.Length;
            using (System.IO.Stream bimstream = new System.IO.MemoryStream(marker.Data, len, marker.Data.Length - len, false)) {
                FSpot.Bim.BimFile bim = new FSpot.Bim.BimFile(bimstream);
                bim.Select(sink);
            }
        }
    }
Ejemplo n.º 3
0
	public FSpot.Iptc.IptcFile GetIptc ()
	{
		string name = PhotoshopSignature.Name;
		JpegHeader.Marker marker = FindMarker (PhotoshopSignature);
		if (marker != null) {
			int len = name.Length;
			using (System.IO.Stream bimstream = new System.IO.MemoryStream (marker.Data, len,
											marker.Data.Length - len, false)) {

				FSpot.Bim.BimFile bim;
				try {
					bim = new FSpot.Bim.BimFile (bimstream);
				} catch {
					// Bim entry with marker "PHUT" is not handled by Bim.cs
					return null;
				}

				// FIXME: What about EntryType.XMP ?
				FSpot.Bim.Entry iptc_entry = bim.FindEntry (FSpot.Bim.EntryType.IPTCNAA);
				if (iptc_entry == null)
					return null;

				using (System.IO.Stream iptcstream = new System.IO.MemoryStream (iptc_entry.Data)) {
					FSpot.Iptc.IptcFile iptc = new FSpot.Iptc.IptcFile (iptcstream);
					return iptc;
				}
			}
		}
		return null;
	}
Ejemplo n.º 4
0
	public void Select (SemWeb.StatementSink sink)
	{
		FSpot.Tiff.Header exif = GetExifHeader ();
		if (exif != null)
			exif.Select (sink);
		
		XmpFile xmp = GetXmp ();
		if (xmp != null)
			xmp.Select (sink);
		
		string name = PhotoshopSignature.Name;
		JpegHeader.Marker marker = FindMarker (PhotoshopSignature);
		if (marker != null) {
			int len = name.Length;
			using (System.IO.Stream bimstream = new System.IO.MemoryStream (marker.Data, len, marker.Data.Length - len, false)) {
				FSpot.Bim.BimFile bim = new FSpot.Bim.BimFile (bimstream);
				bim.Select (sink);
			}
		}
	}