in

ASP.NET Weblogs

This Blog

Syndication

Sponsors

Roiy Zysman

July 2008 - Posts

  • Hacking 101


    Not so much software related , but something to keep in mind when designing user interfaces aimed for security purposes.

    From the following picture, guess which buttons are being used for typing in the parking lot gate code ...

    Image059

     

    BTW, this is a real life parking lot code key..

  • An informative GeoTagging Getting-started Article

    A friend at work , sent me this well documented and informative article on geotagging.
    He got the feeling I was hooked onto this technology after I nagged him about whether his Nokia N95 can take pictures with embedded GPS coordinates (No it can't if you're asking) as a research for my Embedding GPS coordinates and other info in JPEG images with C# post.
    I recommend reading it , especially if you're into digital photography or into technologies mesh ups.

    image image

    Roiy

  • A 16 minutes video on YouTube's infrastructure.


    http://blip.tv/file/1069718/ - ~16 minutes. (Poor sound quality)
    Mostly rely on open source software (MySQL, Apache, etc) and developing their applications with python.
    Nice bit about tracing an error that brought down their systems down to a simple 
    riser card which apparently was the root cause.
    Nothing shocking other than that.
    I guess it is worth the 16 minutes of your lifetime..

    Ironically, this video is not hosted on YouTube ...

    Roiy
     

     

  • Embedding GPS coordinates and other info in JPEG images with C#

    GPS and images are a dynamic duo. GPS modules are becoming cheaper and cheaper which means that we would see more gadgets embedded with a GPS as a standard. Cameras and phones are probably the ones that would be on the front line of GPS embedding early adoption. Currently there is the Nokia's N95 cell phone and there might be soon to see camera's with embedded GPS modules (??) and some funny looking , cumbersome integrations .
    So having these two modules is a blessing for geotaggers.
    What is geotagging you ask? 
    Taken from wikipedia
    Geotagging, is the process of adding geographical identification metadata to various media such as websites, RSS feeds, or images and is a form of geospatial metadata. This data usually consists of latitude and longitude coordinates, though it can also include altitude, bearing, and place names.

    image 

    And if you're lucky enough to have a GPS that can track export it's data , you can embed the  GPS coordinated into the JPEG images. Which means that on top of storing things like the camera model and time of picture taken , it can also store the specific location where the picture was taken. And to take it even further , there are image loading web services that locate on a map pictures that were embedded with their respective GPS coordinates . Panoramio.com is my favorite, Flickr used to support this by simply putting the latitude and longitude as tags , but it looks like it is no longer supported. Use Panoramio , it does the job.

    Here is for example all of the geotagged images around Rome's Pantheon (from Panoramio).

    image

    It appears that it is very simple to read and write these GPS settings from within the JPEG image using .Net's System.Drawing.Image class.
    The data stored in JPEG images complies with the EXIF data format. We can use the Image class to read and write data from and to the JPEG image.
    here is an example:

    Image Pic = Image.FromFile(Filename); 
    PropertyItems = Pic.PropertyItems; 
    PropertyItems[0].Id = 0x0002; //index of the EXIF TAG 
    PropertyItems[0].Type = 5;// 
    PropertyItems[0].Len = length; 
    PropertyItems[0].Value =new byte[length]; 
    Pic.SetPropertyItem(PropertyItems[0]);

    And that's pretty much it, there are a few more tweaks to save the image.
    I'm publishing here a small C# file with a static function to perform a simple action to embed GPS latitude, longitude (Which can be taken from the gps log according to time that the picture was taken).
    It is pretty much straight forward.
    It can be used like so

    WriteLongLat("c:/temp/house_gps.jpg", 33, 0, 48.46, 35, 5, 38.12);

    where the first parameter represents the file name to be embedded and the other parameters represent the lon and lat degrees, minutes, and seconds..
    Feel free to use this as will (LGPL) license.

    Update :  There is an updated post about the attached example here GPS Coordinates in JPEG Example
    Happy Geotagging...
    Roiy

    Technorati Profile

     

  • C# / .Net image filters working on linux (and other cross platforms) with Mono

    When I published Yael , which is basically a set of .Net open source image filters class library, I tried testing that on several linux platforms using Mono. back than Mono was somewhere around the 1.2 version and trying to run several gdi related core lib calls crashed down Mono. recently , with the announcement of the completion of Mono's 2.0 api  I've decided to revisit this test. Another aspect that i've tested didn't go so well so I was a bit pessimistic.

    Short:
    The YAEL example (which is included with the class library content) and other filters tests I've ran worked out perfectly. which means that YAEL can now be used on linux platforms as well..
    And here is the result

    Long:
    Here is how to do this, this is also helpful as a getting started guide if you want to use my library on linux.
    1.download a virtualization application . It can either be VMWare or VirtualPC
    2.download an OpenSuse livecd , I recommend using Mono's preconfigured version from here
    3.Run OpenSuse as a virtual machine
    4.Download the YAEL library from here to a windows machine
    5.Compile the example project and place it on a share
    6.Login to the OpenSuse virtual machine, make sure there is a network connectivity between the virtual machine and the machine with the YAEL example you're just compiled.
       BTW, for this specific livecd the username is linux and the password is mono.
    7.Now here is the tricky part, we have to move the YAEL example bits to the virtual machine.
    7.1 open up a terminal window by clicking on the computer button on the bottom left and picking the terminal application

    7.2 We are going to use a nice gnu app called smbclient , which is basically an ftp over SMB, or in other words an FTP that knows how to connect to a windows share driver
    7.3 For running SMB client run the following cmd on the terminal window that was just opened--> smbclinet //[your share drive machine ip]/[name of share drive] -W [workgroup or domain name] -U [username]
          An example for that would look like this --> smbclient //192.168.1.10/Yael -W home-pc -U roiy
          Where 192.168.1.10 is the machine that holds the share drive with my compiled YAEL example.
    7.4 Enter the user's password and you're in the SMB Clinet FTP like prompt.
    7.5 type lcd /tmp [and hit enter]
    7.6 type recurse [and hit enter]
    7.7 type prompt [and hit enter]
    7.8 type mget * [and hit enter]
    7.9 At this stage you should have moved the Yael example folder to /tmp
    8.Exit smbclient (by hitting CTRL+C) and cd to the /tmp folder
    9.Cd further into the YAEL example bin folder (run ls -ltr for a list of files and directories - the same as dir)
    10. And run the following command to execute the example
        mono YaelExample.exe
    11. At this point, 3 example jpeg filtered files should be created.
    12. Image files can be viewed with a small app called xview. run xview and provide the image file name as a parameter and you should get the following

    So give it a try and tell me how it went...
    Roiy

More Posts