TagFlo is on CNET
May 20th, 2009I just got TagFlo approved on download.cnet.com!
This is big! You can now finally export your selected photos to Flickr! Download v1.1 to get this feature. I also added a method to rotate photos left or right.
The Flickr.NET library made it pretty easy to add Flickr Support.
The central component to TagFlo is accessing the metadata stored in photos and adding additional descriptors. There are two big gotchas that crop up when you work with MetaData in WPF/NET 3.0
The first is that if you are trying to work with Metadata in a thread instead of the main application you have to set the apartment state to STA Thread. Since the image class uses graphics code, it likes to be in this type of thread. Not sure way, but when you add this line: Thread.SetApartmentState(ApartmentState.STA);your life will be easier. There is more information available here.
The other gotcha pops up when you are trying to add new metadata to a file. The metadata for a photo is stored right in the file, usually in the front. Often times there isn’t any extra space between the metadata and the start of the file, so you need to create some white space for the new data you want to add. There is a good method for doing that here.
The two stupid little things took me way to long to figure out. Problem solving is half the fun of programming though!
Small update. I just fixed some bugs I found.
v1.0.1.0
———————————————
- Fixed ISO, All Photos, Photo Set, Rating in selection list
- Removing a directory does not remove subdirectories
- Folder List in the import folder does not update after folder are added or removed
- Fixed sorting by rating
- Fixed SmartSet Filters
I am using LINQ etensively in TagFlo. It is what is used to connect all application to the backend database containing all the information on the photos. I was previously using ADO.NET to connect to my DB. ADO.NET makes SQL like calls to insert, update and delete information from the database. LINQ is a much more abstract way of accessing the db. You can pull off some interesting tricks using it.
In order to map LINQ to you SQL based DB, you can use either Linq to SQL (L2SQL) or Entity Framework (EF). Linq to SQL gives you more of a direct mapping, where the different SQL column names are used directly in your queries. With EF you get to abstract your DB in a data layer. This, in theory, should make it easier to change the db without having to redo your program.
Both of these solutions are good solutions. The only problem is that not all of their features work with SQL Server Compact Edition (SQLCE). I am using SQLCE because I need a light weight DB technology to store and sort all the information about the photos in TagFlo. My decsion to use EF instead of L2SQL was based upon how much better it worked with SQLCE.
Here is a run down of the trouble each has working with SQLCE:
Entity Framework
Linq to SQL
I finally finished up the latest release. I think I have been work on this forever. Download it and give it a try. There has been a big update of the backend. I also finally got a site setup on CodePlex. I am going to try and get better about doing some active development of TagFlo.
The source code is all available at tagflo.codeplex.com. Give it a look and leave me a message if you want. If you find any bugs, leave them in the issue tracker.
I am just wrapping a big update to TagFlo. I completely stipped out the old data layer I was using, ADO.Net DataSets, and replaced it with a combination of Linq and the ADO.Net Entity Framework. I am not quite sure if it was worth the effort, but it was a great learning experience. I probably could have just kept DataSets and used Linq on top of it. Either way things have been streamlined a bit and I will have the update out shortly.