Author Topic: .NET "wrapper" dll  (Read 16125 times)

SarahC

  • Newbie
  • *
  • Posts: 5
Re: .NET "wrapper" dll
« Reply #15 on: June 02, 2015, 03:45:15 AM »
SarahC, I just downloaded your source code and noticed you converted the C# code to vb, did you tried using the dll instead? I'm using it in my mp3Manager without problems.

Sorry, I've been away from my dev environment!

I'll try that, for sure! That may have cured it - but the error only occurs on huge lists - is your MP3 collection large?

(and how do I get notifications on here?! I'm off to check "properties".)

rkamarowski

  • Newbie
  • *
  • Posts: 2
Re: .NET "wrapper" dll
« Reply #16 on: January 23, 2016, 01:49:31 PM »
I'm getting the following error when the Start() method is executed:

The specified executable is not a valid application for this OS platform.

Code: [Select]
                ExifToolWrapper etw = new ExifToolWrapper();

                etw.Start();

I'm running VS 2015 on Windows 10

brain2cpu

  • Newbie
  • *
  • Posts: 8
Re: .NET "wrapper" dll
« Reply #17 on: January 23, 2016, 03:16:57 PM »
Did you replaced the dummy exiftool exe with the real one?

rkamarowski

  • Newbie
  • *
  • Posts: 2
Re: .NET "wrapper" dll
« Reply #18 on: January 23, 2016, 04:47:51 PM »
ugh... thank you!

lyrico

  • Newbie
  • *
  • Posts: 1
Re: .NET "wrapper" dll
« Reply #19 on: November 16, 2016, 03:11:59 PM »
Sorry to resurrect an old thread.  I've been playing around with the tool and it works great :)  However, I was wondering if there's any way to pass in a stream to a file instead of the physical file itself?  Often case, the only thing I get is a byte array of the file.  So instead of saving all the bytes to a temporary file, I would like to just pass in that byte array as a stream.

Thanks!

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 11047
    • ExifTool Home Page
Re: .NET "wrapper" dll
« Reply #20 on: November 16, 2016, 03:41:54 PM »
This is a basic functionality for the Image::ExifTool Perl library, but unfortunately the .NET wrapper goes through the exiftool application.  Here, the only thing you could possibly do would be to create some sort of pipe from your bytes array (which may be possible with .NET, I don't know), but then you would probably run into troubles with the .NET wrapper not supporting pipes (I'm guessing the wrapper probably uses pipes for the command-line arguments, and if so you probably can't pipe the images too).

So without knowing how the .NET wrapper works, I am guessing that it won't do what you want.

You could, however, launch ExifTool directly piping the image if you can figure out how to do that, without the ExifTool .NET wrapper.

- Phil
...where DIR is the name of a directory containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

brain2cpu

  • Newbie
  • *
  • Posts: 8
Re: .NET "wrapper" dll
« Reply #21 on: November 17, 2016, 04:22:03 AM »
Unfortunately the wrapper does not support byte array, it works with filenames only.

macdonnie

  • Newbie
  • *
  • Posts: 1
Re: .NET "wrapper" dll
« Reply #22 on: December 05, 2016, 08:59:44 PM »
Fantastic Tool and Wrapper!

I'm using the wrapper and the code executes until I call SetExifInto(). At that point my C# code pauses and will not continue. Am I doing something wrong? Do I need to call the function in a different manner or is it something else?

Some notes:
1) I can see that d is being populated and changed properly.
2) The SetExifInto is working and changing the 'Make' in the image's properties
3) When I call Start() two different exittool(-k).exes start up. And remain open the whole time. The first one has a memory footprint of 44MBs and the 2nd has a memory footprint of 0.6MBs


Code: [Select]
        public static void writeTag5()
        {
            using (BBCSharp.ExifToolWrapper extw = new ExifToolWrapper())
            {
                // Start ExifTool
                extw.Start();
                // Get Metadata
                Dictionary<string, string> d = extw.FetchExifFrom("C:\\Users\\donal\\Desktop\\P1020661_Fixed_b_w2.jpg");
                // Remove existing Lens Model
                d.Remove("Make");
                // Add new Lens Model
                d.Add("Make", "testing");
                //Write new Metadata
                extw.SetExifInto("C:\\Users\\donal\\Desktop\\P1020661_Fixed_b_w2.jpg", d, true);

            }
        }

Thanks,
-Don

brain2cpu

  • Newbie
  • *
  • Posts: 8
Re: .NET "wrapper" dll
« Reply #23 on: December 06, 2016, 03:40:48 AM »
Everything seems alright in your code and notes, but it is not the best way to do it. You should send to SetExifInto() only things you want to change:
Code: [Select]
extw.SetExifInto("C:\\Users\\donal\\Desktop\\P1020661_Fixed_b_w2.jpg", new Dictionary<string, string> { ["Make"] = "testing" }, true);
however the code should not stop.

brain2cpu

  • Newbie
  • *
  • Posts: 8
Re: .NET "wrapper" dll
« Reply #24 on: January 10, 2017, 05:48:07 AM »
Please use this new version, a possible stall in SetExifInto is fixed.