goldengel / exiflibrary

Automatically exported from code.google.com/p/exiflibrary
MIT License
0 stars 0 forks source link

Cannot write EXIF #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load original image
2. Draw sth on it drawellipse()etc...
3. Save EXIF ImageFile.Save(...) memory out of range

What is the expected output? What do you see instead?

Saved file, memory leak.

What version of the product are you using? On what operating system?

Current version, win7

Concerns each image.

Original issue reported on code.google.com by ole...@gmail.com on 21 Dec 2010 at 10:56

GoogleCodeExporter commented 8 years ago
Can you show me some code? How do you load and modify the image, how do you 
save it? Do you extract the Exif data before or after modifying?

Thanks,
Ozgur

Original comment by oozcitak on 29 Dec 2010 at 4:11

GoogleCodeExporter commented 8 years ago
Closing due to lack of feedback.

Original comment by oozcitak on 25 Jan 2011 at 3:06

GoogleCodeExporter commented 8 years ago
Sory for the lag, I had very little time recently and forgot about it.

I load file as Image , draw in it like:
g.DrawImage(map, location.X, location.Y, size.Width, size.Height);
save it via Image class.
Later open via ImageFile if = ImageFile.FromFile("same path as save");
if.Properties[ExifTag.GPSLongitude] = new GPSLatitudeLon,,,,,
if.save

Original comment by ole...@gmail.com on 25 Jan 2011 at 3:14

GoogleCodeExporter commented 8 years ago

Original comment by oozcitak on 25 Jan 2011 at 6:43

GoogleCodeExporter commented 8 years ago
I couldn't reproduce this. Here is what I tried:

using (Image image = Image.FromFile ("/home/ozgur/1.JPG"))
using (Graphics g = Graphics.FromImage (image)) {
    g.DrawLine (Pens.Red, 0, 0, image.Width, image.Height);
    image.Save ("/home/ozgur/2.JPG");
}
ImageFile exifimage = ImageFile.FromFile ("/home/ozgur/2.JPG");
exifimage.Properties[ExifTag.GPSLongitude] = new GPSLatitudeLongitude 
(ExifTag.GPSLongitude, 1, 1, 1);
exifimage.Save ("/home/ozgur/3.JPG");

Original comment by oozcitak on 23 May 2011 at 10:04

GoogleCodeExporter commented 8 years ago
Got OutOfMemoryException - i need to copy metadata entries from one image to 
another. My code is pretty simple:

ImageFile ExifFile = ImageFile.FromFile(InputFile);
            ImageFile NewExifFile = ImageFile.FromFile(OutputFile);

            if (ExifFile.Properties.Count > 0)
            {
                foreach (var Property in ExifFile.Properties)
                {
                    NewExifFile.Properties.Add(Property);
                }
            }

Original comment by quadrop...@gmail.com on 22 Aug 2011 at 11:10

GoogleCodeExporter commented 8 years ago
Failure details:

JPEGFile.cs:878

for (int i = 0; i < fillerbytecount; i++)
    stream.WriteByte(0xFF);

Stack trace:

   in System.IO.MemoryStream.set_Capacity(Int32 value)
   in System.IO.MemoryStream.EnsureCapacity(Int32 value)
   in System.IO.MemoryStream.WriteByte(Byte value)
   in ExifLibrary.JPEGFile.WriteIFD(MemoryStream stream, Dictionary`2 ifd, IFD ifdtype, Int64 tiffoffset, Boolean preserveMakerNote) in ...\JPEGFile.cs:878
   in ExifLibrary.JPEGFile.WriteExifApp1(Boolean preserveMakerNote) in ...\JPEGFile.cs:728
   in ExifLibrary.JPEGFile.Save(Stream stream, Boolean preserveMakerNote) in ...\JPEGFile.cs:190
   in ExifLibrary.JPEGFile.Save(String filename, Boolean preserveMakerNote) in ...\JPEGFile.cs:239
   in ExifLibrary.JPEGFile.Save(String filename) in ...

Original comment by quadrop...@gmail.com on 22 Aug 2011 at 11:25

GoogleCodeExporter commented 8 years ago
Hey, are you going to fix this bug?

Original comment by quadrop...@gmail.com on 12 May 2012 at 8:46

GoogleCodeExporter commented 8 years ago
Got the same error for trying to write the MakerNote (out of curiosity).

Original comment by felix.he...@gmail.com on 17 Jun 2012 at 12:11

GoogleCodeExporter commented 8 years ago
Fixed by r93.

Original comment by oozcitak on 22 Aug 2012 at 12:05