[Mono-bugs] [Bug 942135] New: Loading an Image from a MemoryStream does not load Properties

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Aug 18 13:14:09 UTC 2015


http://bugzilla.novell.com/show_bug.cgi?id=942135


            Bug ID: 942135
           Summary: Loading an Image from a MemoryStream does not load
                    Properties
    Classification: Novell Products
           Product: MonoTouch
           Version: unspecified
          Hardware: i386
                OS: Red Hat 6.2
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Class Libraries
          Assignee: frego at suse.com
          Reporter: nikki at trumphurst.com
        QA Contact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

Created attachment 644141
  --> http://bugzilla.novell.com/attachment.cgi?id=644141&action=edit
Code to reproduce.

Loading an Image using Image.FromStream does not load the Image Properties:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;

namespace gprop {
  class Program {
    static void Main(string[] args) {
      foreach (string arg in args)
        display(arg);
    }

    static void display(string file) {
      using (Image img = Image.FromFile(file)) {
        display(img);
      }
      using (FileStream f1 = new FileStream(file, FileMode.Open,
FileAccess.Read)) {
        using (MemoryStream m1 = new MemoryStream()) {
          f1.CopyTo(m1);
          m1.Position = 0;
          using (Image img = Image.FromStream(m1)) {
            display(img);
          }
        }
      }
    }

    static void display(Image img) {
      Console.WriteLine("Properties");
      foreach (PropertyItem pi in img.PropertyItems) {
        Console.WriteLine("{0:x4}:{1}", pi.Id,
BitConverter.ToString(pi.Value));
      }
    }
  }
}

If run under Linux, this prints all the properties of the image when loaded
direct from a file, but prints no properties when loaded from a MemoryStream.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-bugs/attachments/20150818/11de7354/attachment.html>


More information about the mono-bugs mailing list