Internet, UNIX, Video, Leisure…
Web
Amino Aminet A125 serial cable schematis
26/08/11
Thanks to Sudhir this is the schematics and the file to create the PCB.
As he explain, the A125 (maybe others) are in 3.3v levels, which is not TTL compatible (and is also different from a RS-232 serial cable !!! don’t use a serial cable directly on it as it have a +_15v signal amplitude which may destroy your Amino. Actualy I did this without destroying it… but still….).
Again, use this at your own risk… we are not responsible.
WordPress NextGEN Gallery and GPS data
18/01/11
NextGen(eration) Gallery is a WordPress plugin from Alex Rabe. It provides image galleries, albums with great ease of administration.
As said by the author, it fills a gap in WordPress gallery systems.
It can handle « display » templates, which can be added to the plugin Views or simply in your theme. That’s what I’m working on right now for the Photo Theme I’m using in my new Photo Blog.
This way you don’t have to install another plugin and use hooks.
While it’s working well, it still have some features missing.
One of the missing stuffs is beeing able to display GPS data.
My photo blog have Geo-Tagged pictures. I want to be able to display them along with a google map image so my readers can see where it was taken. I also want to display some of the EXIF informations, like lense type, aperture, shutter speed and so on…
While some of them (most) are already handeled by the NextGen gallery, some of them are not.
NextGen Gallery is using the exif_read_data function to get the data from the file like :
Then, the RAW exif datas are separated in arrays. When trying to access the EXIF tags (using get_EXIF), only the part of the array under [EXIF] will be used. In fact this is partly false, as the get_EXIF function also dig under IFD0 and WINXP.
As the GPS data from my Nikon D700 are under the [GPS] array, there is no chance that NextGen gallery sees them even if you use the wordpress filter to add some new EXIF tags.
Then you only have one solution : check in the RAW meta-data or… change NextGen so it can handle them in the EXIF tags stored in the database.
So, my solution is divided in few parts :
- Hardcode some new EXIF tags
- get the GPS data inside get_EXIF
- add a function to parse the GPS data and make them readable/usable by Google Map
Let’s do it :
Hardcode some new EXIF tags
In the file lib/meta.php, change the get_common_meta function so it look like :
-
function get_common_meta() {
-
global $wpdb;
-
-
‘aperture’ => 0,
-
‘credit’ => »,
-
‘camera’ => »,
-
‘caption’ => »,
-
‘created_timestamp’ => 0,
-
‘copyright’ => »,
-
‘focal_length’ => 0,
-
‘iso’ => 0,
-
‘shutter_speed’ => 0,
-
‘flash’ => 0,
-
‘title’ => »,
-
‘altitude’ => »,
-
‘longitude’ => »,
-
‘latitude’ => »,
-
‘timestamp’ => »,
-
‘datestamp’ => »,
-
‘satellites’ => »,
-
‘direction’ => »,
-
‘lense’ => »,
-
‘keywords’ => »
-
);
As you can see, I add all the GPS data, plus « lense », which is just a hook as the EXIF tag for the lense is actualy « UndefinedTag:0xA434″
You can also add the new tags in the i8n translation function
-
function i8n_name($key) {
-
-
‘aperture’ => __(‘Aperture’,‘nggallery’),
-
‘credit’ => __(‘Credit’,‘nggallery’),
-
‘camera’ => __(‘Camera’,‘nggallery’),
-
‘caption’ => __(‘Caption’,‘nggallery’),
-
‘created_timestamp’ => __(‘Date/Time’,‘nggallery’),
-
‘copyright’ => __(‘Copyright’,‘nggallery’),
-
‘focal_length’ => __(‘Focal length’,‘nggallery’),
-
‘iso’ => __(‘ISO’,‘nggallery’),
-
‘shutter_speed’ => __(‘Shutter speed’,‘nggallery’),
-
‘title’ => __(‘Title’,‘nggallery’),
-
‘author’ => __(‘Author’,‘nggallery’),
-
‘tags’ => __(‘Tags’,‘nggallery’),
-
‘subject’ => __(‘Subject’,‘nggallery’),
-
‘make’ => __(‘Make’,‘nggallery’),
-
‘status’ => __(‘Edit Status’,‘nggallery’),
-
‘category’ => __(‘Category’,‘nggallery’),
-
‘keywords’ => __(‘Keywords’,‘nggallery’),
-
‘created_date’ => __(‘Date Created’,‘nggallery’),
-
‘created_time’ => __(‘Time Created’,‘nggallery’),
-
‘position’ => __(‘Author Position’,‘nggallery’),
-
‘city’ => __(‘City’,‘nggallery’),
-
‘location’ => __(‘Location’,‘nggallery’),
-
‘state’ => __(‘Province/State’,‘nggallery’),
-
‘country_code’ => __(‘Country code’,‘nggallery’),
-
‘country’ => __(‘Country’,‘nggallery’),
-
‘headline’ => __(‘Headline’,‘nggallery’),
-
‘credit’ => __(‘Credit’,‘nggallery’),
-
‘source’ => __(‘Source’,‘nggallery’),
-
‘copyright’ => __(‘Copyright Notice’,‘nggallery’),
-
‘contact’ => __(‘Contact’,‘nggallery’),
-
‘last_modfied’ => __(‘Last modified’,‘nggallery’),
-
‘tool’ => __(‘Program tool’,‘nggallery’),
-
‘format’ => __(‘Format’,‘nggallery’),
-
‘width’ => __(‘Image Width’,‘nggallery’),
-
‘height’ => __(‘Image Height’,‘nggallery’),
-
‘flash’ => __(‘Flash’,‘nggallery’),
-
‘latitude’ => __(‘Latitude’,‘nggallery’),
-
‘longitude’ => __(‘Longitude’,‘nggallery’),
-
‘altitude’ => __(‘Altitude’,‘nggallery’),
-
‘lense’ => __(‘Lense’,‘nggallery’),
-
);
get the GPS data inside get_EXIF
Now, every time you insert a new image or re-import the meta-data, the new tags will be asked. We need to change the get_EXIF function so it can find them.
Still in lib/meta.php, go down to the get_EXIF function and change it to :
-
function get_EXIF($object = false) {
-
-
if ( !$this->exif_data )
-
return false;
-
-
-
-
$exif = $this->exif_data[‘EXIF’];
-
-
$meta[‘created_timestamp’] = date_i18n(get_option(‘date_format’) . ‘ ‘ . get_option(‘time_format’), $this->exif_date2ts($exif[‘DateTimeDigitized’]));
-
$meta[‘focal_length’] = $this->exif_frac2dec( $exif[‘FocalLength’] ) . __(‘ mm’,‘nggallery’);
-
$meta[‘iso’] = $exif[‘ISOSpeedRatings’];
-
$meta[‘shutter_speed’] = $this->exif_frac2dec ($exif[‘ExposureTime’]);
-
$meta[‘shutter_speed’] =($meta[‘shutter_speed’] > 0.0 and $meta[‘shutter_speed’] < 1.0) ? ( ’1/’ . round( 1 / $meta[‘shutter_speed’], -1) ) : ($meta[‘shutter_speed’]);
-
$meta[‘shutter_speed’] .= __(‘ sec’,‘nggallery’);
-
}
-
//Bit 0 indicates the flash firing status
-
$meta[‘flash’] = ( $exif[‘Flash’] & 1 ) ? __(‘Fired’, ‘nggallery’) : __(‘Not fired’,‘ nggallery’);
-
-
$meta[‘lense’] = $exif[‘UndefinedTag:0xA434′];
-
}
-
-
// additional information
-
$exif = $this->exif_data[‘IFD0′];
-
-
$meta[‘camera’] = $exif[‘Model’];
-
$meta[‘make’] = $exif[‘Make’];
-
$meta[‘Orientation’] = $exif[‘Orientation’];
-
}
-
// additional GPS information
-
$exif = $this->exif_data[‘GPS’];
-
// send exif data to the function to get GPS on one line
-
$GPS=self::get_Exif_GPS($exif, 1);
-
$meta[‘latitude’] = $GPS[‘latitude’];
-
$meta[‘longitude’] = $GPS[‘longitude’];
-
$meta[‘altitude’] = $GPS[‘altitude’]." metres";
-
$meta[‘timestamp’] = $GPS[‘timestamp’];
-
$meta[‘direction’] = $GPS[‘direction’];
-
$meta[‘satellites’] = $exif[‘GPSSatellites’];
-
$meta[‘datestamp’] = $exif[‘GPSDateStamp’];
-
}
-
}
You can see two things here :
- if the meta asked is « lense », we look for the un-named attribute
- when we are done with EXIF and IFD0, we check in the GPS array
add a function to parse the GPS data and make them readable/usable by Google Map
Now we create the function to re-calculate the GPS coords. Create a function somewhere in the class. A good place is at the end of the lib/meta.php file, just before the last closing bracket.
-
function get_Exif_GPS($exif, $assoc = false) {
-
//get the Hemisphere multiplier
-
$LatM = 1; $LongM = 1;
-
if($exif["GPSLatitudeRef"] == ‘S’) {
-
$LatM = -1;
-
}
-
if($exif["GPSLongitudeRef"] == ‘W’) {
-
$LongM = -1;
-
}
-
-
//get the GPS data
-
$gps[‘LatDegree’]=$exif["GPSLatitude"][0];
-
$gps[‘LatMinute’]=$exif["GPSLatitude"][1];
-
$gps[‘LatgSeconds’]=$exif["GPSLatitude"][2];
-
$gps[‘LongDegree’]=$exif["GPSLongitude"][0];
-
$gps[‘LongMinute’]=$exif["GPSLongitude"][1];
-
$gps[‘LongSeconds’]=$exif["GPSLongitude"][2];
-
$gps[‘Altitude’]=$exif["GPSAltitude"];
-
$gps[‘TimeHour’]=$exif["GPSTimeStamp"][0];
-
$gps[‘TimeMin’]=$exif["GPSTimeStamp"][1];
-
$gps[‘TimeSec’]=$exif["GPSTimeStamp"][2];
-
$gps[‘direction’]=$exif["GPSImgDirection"];
-
-
//convert strings to numbers
-
foreach($gps as $key => $value) {
-
if($pos !== false) {
-
$gps[$key] = $temp[0] / $temp[1];
-
}
-
}
-
-
//calculate the decimal degree
-
$result[‘latitude’] = $LatM * ($gps[‘LatDegree’] + ($gps[‘LatMinute’] / 60) + ($gps[‘LatgSeconds’] / 3600));
-
$result[‘longitude’] = $LongM * ($gps[‘LongDegree’] + ($gps[‘LongMinute’] / 60) + ($gps[‘LongSeconds’] / 3600));
-
$result[‘altitude’] = $gps[‘Altitude’];
-
$result[‘timestamp’] = $gps[‘TimeHour’].‘:’.$gps[‘TimeMin’].‘:’.$gps[‘TimeSec’];
-
$result[‘direction’] = $gps[‘direction’];
-
-
if($assoc) {
-
return $result;
-
}
-
-
}
Conclusion
Re-importing the meta-data of all your pictures should add the new stuffs.
I’v posted in the WordPress forum and asked for this to be added to the NextGen Gallery dev tree. Still have no answer for now. Maybe someone will come with a better code or better idea ?
I also asked for someone to check how GPS data are included in files from other brands as I can only tell for the Nikon’s D700.
Flashing an Amino Set Top Box
24/02/09
Amino company and resellers are really quiet about all the possibilities of the product.
I made a post some time ago about configuring the Amino to boot with DHCP and get the config through this or through DHCP.
This post was really popular and people began to ask me for firmware and informations on how to upgrade. Of course, I can’t provide anything like firmware. My reseller here is France is OK to sell it for 10€ for 4 Amino stb… Or you can find it somewhere on Internet. Please, don’t ask for it, I don’t have the latest nor the Opera firmware.
FeedBurner… if you do a lot of hits
3/12/08
You should already know this.
Feedburner is a tool, newly acquired by Google (one more) which will, by the aim of a plugin to your blog software, redirect people reading your RSS to their site. This will substentialy reduce the load of your server. This will also collect some stats helping you to see who is subscribed.
I think many other features exists but I’m just too new to know all. Just have a look at their blog here.
It really seems « feed » is the new word on internet, with the latly relase FriendFeed tool, agregating all of your social network other tools… cool isn’t it ?
GTA IV, now !
29/04/08
GTA IV, the new opus is out, right now !
Time for me to buy a PS3.
For those of you who don’t have it yet, you can listen to GTA radios online :
Or check the others here at http://www.rockstargames.com/IV/#?page=music&content=stations
Amino 103/110 DHCP configuration
24/04/08

Know what a Set-Top-Box is ? By this time everybody should know. This little box you plug to your TV so you can see video channels or VoD (Video On Demand) streamed from another computer or from your ISP.
We had a project at work about replacing TV in almost every office, connected to coaxial cable, by a network based system. This have two advantages, and only one drawbacks :
- It is netwok based and you are not limited with the number of channel
- You can also watch TV on your desktop or laptop computer, no need to have a TV
- It is nework based, so you need a real good network
La musique selon vos criteres
5/03/08
Google is everywhere
28/12/07

One new API from Google. This one allow you to create charts (graphiques, pour les francophones).
Philippe Mougin is our guest and comes with a clean example with integration to Apple’s Cocoa programming. Check this here.
Apache2 un Ubuntu 7.10
9/12/07
As usual in any new linux distro, Apache is not installed the same way as the previous. on ubuntu, you’ll find a bunch of files and directory in /etc/apache2.
I ended searching on « how can I add the LDAP authentication module, authzn_ldap. This module is in the mods-available directory.
One solution seems to link it to mods-enabled directory.
Or you can use the (new to me) utility ‘a2enmod’, which stand for Apache2 Enable Module. you also have a2dismod to remove a module or a2dissite to remove a site (if your site conf is in the /etc/apache2/site-available directory.
I haven’t been waiting for Ubuntu to offer that as I’m doing such a thing for almost 8 years now. Moreover, and this is something I would like to release one day, all my apache vhost conf is stored in Ldap, and managed through a set of PHP pages. I just have to change the conf from the web interface and clic « dump conf », and every modified entry is dumped to the right file, and the link is made or removed automaticaly if needed.
Wait for it…
Cna Yuo Raed Tihs ?
5/12/07
Only great minds can read this
This is weird, but interesting! This is a cool thing check it out.
fi yuo cna raed tihs, yuo hvae a sgtrane mnid too
Cna yuo raed tihs? Olny 55 plepoe out of 100 can.
i cdnuolt blveiee taht I cluod aulaclty uesdnatnrd waht I was rdanieg. The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno’t mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Azanmig huh? yaeh and I awlyas tghuhot slpeling was ipmorantt! if you can raed tihs forwrad it
FORWARD ONLY IF YOU CAN READ IT




