Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, September 26, 2007 6:09:00 PM(UTC)

nzmike  
nzmike

Groups: Registered
Posts: 3


Hi,

I am looking for an image processing library (to use with .Net 2.0/VS2005)  that can handle Canon RAW files but so far I have not seen any mention of RAW file support in any of the forums or in the supported file formats or in the features pages I have looked at on this site.  I have also done a search for 'raw' and it only seems to refer to 'SARAW' (whatever that is).
So, does Leadtools Raster library (which is what I think I'd need) support processing of Canon RAW files or not?

If not, are you planning to offer that support?  What I want to do (via an SDK obviously)  is to be able to take a folder of Canon Raw files (CRW, CR2, etc) and have them resized, sharpened, copyright info added (etc etc) into web-ready thumbnails and images - much as you'd do with a Photoshop batch action.  (I also want to be able to read the EXIF info from the CR* files as well.)  I am trying to avoid getting into the Photoshop SDK scenario as that seems vastly over-complicated - this is something I want to provide to a client quite quickly so they can upload property images to their web site with one .Net app that each estate agent or valuer can use in the office - so they would plug their camera in to the PC, run the app, select the CR* photos from the camera, specify various info  for the creation of the jpegs then have the whole lot converted at once.  I have already written the app to support the JPG preview files - what I need now is a good library to handle the RAW files as my client prefers their staff to use only RAW format (for quality and archival purporses).  Will any of the LeadTools SDK's allow me to do this sort of batch CR* conversion?

The other thing I need to do is more tricky and I have not found any product  to do this (or even anyone that could point me in the right direction on how to program it) but I need to compare two JPG's to see if they are exactly the same.  The same client wants to be able to select a JPG and search through a folder (or folders) of other jpg's to see if that *exact*  image is repeated elsewhere... I imagine you'd need to compare every bit for color and a bunch of other stuff (or maybe just the histogram?) but I have no idea how to go about doing this! 
Does Leadtools have anything that could do this and if not would anyone know how to do it? (I am using VS2005, C# or VB... just need some examples or ideas!)

Thanks in advance for any info or advice anyone can supply. (Sorry this post is so long but I need to make sure my client would be buying the right product for me to deliver what they want.)

Mike
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, September 27, 2007 5:55:51 AM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Hello,
 
Yes, we do support RAW file formats, in your case CRW files.  If you search the help file for "RasterImageFormat Enumeration" you will see a list of all file formats supported.  Our .NET documentation may not be online.  You can download the trial version of LEADTOOLS v15 so that you can get access to the .NET documentation.
 
With the SDK you can resize, sharpen, and annotate (add copyright information) and save to web-ready images/thumbnails.  Our SDK does support reading EXIF tags, but it supports EXIF 2.0 tags and a few EXIF 2.1 tags.  Search for "RasterCommentMetadataType Enumeration" in the .NET docs to see all the tags we support.  You will be able to do all of this as a batch process.
 
So you want to compare two JPGs to see if they are excatly the same?  Do you mean bit-by-bit identical, like including the EXIF info, image size, DPI of the image, etc.?  In that case all you need to do is a MD5 hash of the file.  It will give you a 32 character hexadecimal string.  If you have two files, and lets say you run the hash function on them.  If they are the same bit-by-bit, then the 32 character string that the hash returns will be the same for both files.  If one of the images is off by even a single bit, then the hash string will be completely different.
 
But if you want to compare two images that are of different quality and size, and see if they are the same, then you will have to devise your own algorithm.  Because it's a very complex process.
 
To summarize, our SDK can do all you need to do,  except for the MD5 hash.  The .NET framework has built-in support for MD5 hashing, but it requires a couple other steps to process files.  I can post the code for it, if you need it.  Also, our .NET documentation has samples for all of the stuff above, but if you get stuck you can post here or email us at support@leadtools.com for assistance.  If I missed a question or you have more questions feel free to reply.
 
#3 Posted : Monday, October 1, 2007 2:31:54 PM(UTC)

nzmike  
nzmike

Groups: Registered
Posts: 3


Hi,

Many thanks for your detailed answer - I appreciate it.  As you suggested I will download the trial of v15 and look at the things you mentioned and create some tests just so I can be %100 sure I can do what I need to for my client.  I am a little worried the EXIF info on some of the cameras my clients use might not be v2.0 though - I know a couple of agents are still using 300D's and 350D's (and older Nikon DSLR's) which I think might have only had EXIF 1.1 - but I will have to check that out.

Thanks for the info of the MD5 hash - if you did have a code snippet you could post I'd appreicate it.  I've used MD5 before for password and authentication stuff but not to compare 2 objects so I will look into that as well... but an example would be a life saver if you had it!  I have told my client that we can only do a comparison on files that are identical in every way which they are Ok with - the problem they have is that their agents have a tendancy of uploading photos  more than once to different folders so they just want a way to clean up their server and image database (ThumbPlus 7) so I think the MD5 method should will work pretty well.  I will score point big time if I can implement this as my client's previous developer told them it was impossible (as I thought it was).

So far Leadtools is looking very promising - my client will buy whatever package I instruct them to and my only other candidate is Aurigma's GraphicsMill and they have not replied to my questions at all - so Leadtools is my preferred choice already. 

Thanks again,

Mike
 
#4 Posted : Tuesday, October 2, 2007 4:47:32 AM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

You're welcome.  Here the code for hashing files.  The string variable md5Hash is the object to use for your comparisons.

//////// START OF CODE

string file;
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
StringBuilder stringbuilder = new StringBuilder();
 
FileStream fileStream = new FileStream(file, FileMode.Open, FileAccess.Read);
byte[] hash = md5.ComputeHash(fileStream);
fileStream.Close();
 
foreach (byte hex in hash)
    stringbuilder.Append(hex.ToString("x2"));
 
string md5Hash = stringbuilder.ToString();

//////// END OF CODE
 
#5 Posted : Tuesday, October 2, 2007 3:10:30 PM(UTC)

nzmike  
nzmike

Groups: Registered
Posts: 3


Thanks for that... I have now demonstrated to my client that we can find matching images and have a rough prototype of an app they can use... not sure why I never thought of using the MD5 hash - now it seems so obvious!

I am now going spend a few days evaluating Leadtools 15 to create another prototype for my client containing the main functionality they want but my expectation would be that we will purchase Leadtools.

Thanks again for the great support.

Mike


PS: Why does the reply or edit page take so long to finish loading?  My browser (Firefox 2) sits there for a good 15-20 seconds saying "Waiting for support.leadtools.com..." when everything on the page looks like it's loaded already... and since the rich text box is not enabled you can't even start typing - it makes it very frustating when you want to do a quick reply or edit.  (And I'm on a *very* fast corporate 'net connection). 
 
#6 Posted : Wednesday, October 3, 2007 7:20:53 AM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

You're welcome.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.122 seconds.