Picasa Picture Rotation Used for MP (1 Viewer)

mbuzina

Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    Hi All,

    I missed one thing in the MP Pictures module: The ability to read rotation information from Googles Picasa Software. This is very is to be done, since it includes an .ini file in every directory it worked on. So I just sat down and added some code to the picture db library. It is located behiond the EXIF check for rotation and it may overwrite it if picasa has rotated the picture. The Code is:


    Code:
    if(File.Exists(Path.GetDirectoryName(strPic) + "\\Picasa.ini")) {
    
    using(StreamReader sr = File.OpenText(Path.GetDirectoryName(strPic) + "\\Picasa.ini")) {
    		try {
    			string s = "";
    			bool searching = true;
    			while((s = sr.ReadLine()) != null && searching) {
    				if(s.ToLower() == "[" + Path.GetFileName(strPic).ToLower() + "]") {
    					do {
    						s = sr.ReadLine();
    						if(s.StartsWith("rotate=rotate(")) {
    							// Find out Rotate Setting
    							try {
    								iRotation = int.Parse(s.Substring(14, 1));
    							} catch(Exception ex) {
    								_log.Error("error converting number picasa.ini", ex.Message, ex.StackTrace);
    							}
    							searching = false;
    						}
    					} while(s != null && !s.StartsWith("[") && searching);
    				}
    			}
    		} catch(Exception ex) {
    			_log.Error("file read problem picasa.ini", ex.Message, ex.StackTrace);
    		}
    	}
    }
    I also attached the file. Maybe someone can put it into the svn versions (Smirnuff still on the picture module?). I believe it to small for a patch. :D

    ** EDIT **
    No Idea how to make the code show corret. vBulletin Issue?
     

    knutinh

    Portal Pro
    September 4, 2005
    558
    2
    My top requests for My pics:
    1. smoother transitions (seems to loose vsync or something on my pc)
    2. image "playlists". Id like to keep a rigid system of pictures in cronologic folders, but often, Id like to make a "theme" across those borders when I am expecting visitors.

    3. Of course, automatic face recognition, add metainfo to every frame about what people are on it, couple with time and make a searchable database :-D

    The last one was kidding ;-)

    -k
     

    Users who are viewing this thread

    Top Bottom