LinuxMCE Forums

General => Developers => Topic started by: chriss on May 17, 2009, 04:53:38 pm

Title: Idea: Photo management
Post by: chriss on May 17, 2009, 04:53:38 pm
Hi devs,

I'm currently thinking about making LMCE usable to manage my digital photos. Here are some ideas of what I have in mind. The good thing is, the basics are there - a powerful media tagging system. Unfortunately the tagging capabilities for pictures are really limited, the only tag offered in the web admin is "Title"...
Here are some things I would like to do

All of this seems to be pretty straight forward since it's only extending the existing system. What do you guys think? Good/bad idea? Am I missing something?

/chriss


BTW, another idea that is sticking to my mind for some time: having a second web app with a more user friendly interface (AJAX etc.) to support all tasks a normal user will do, e.g. managing your media, scheduling recordings and so on. The web admin could become a real administration frontend. However, this is a much bigger task :)
Title: Re: Idea: Photo management
Post by: tschak909 on May 17, 2009, 09:05:42 pm
Go for it. First step is checking out UpdateMedia from our LinuxMCE-0810 SVN and working with that.

-Thom
Title: Re: Idea: Photo management
Post by: totallymaxed on May 22, 2009, 01:00:37 pm
Hi devs,

I'm currently thinking about making LinuxMCE usable to manage my digital photos. Here are some ideas of what I have in mind. The good thing is, the basics are there - a powerful media tagging system. Unfortunately the tagging capabilities for pictures are really limited, the only tag offered in the web admin is "Title"...
Here are some things I would like to do
  • add EXIF/IPTC support for update media deamon (at least on my 0710 system no tags from the images are synced to the DB)
  • have more tags, maybe even custom tags?
  • allow linking of tags
  • allow linking of files
  • improve web admin

All of this seems to be pretty straight forward since it's only extending the existing system. What do you guys think? Good/bad idea? Am I missing something?

/chriss


BTW, another idea that is sticking to my mind for some time: having a second web app with a more user friendly interface (AJAX etc.) to support all tasks a normal user will do, e.g. managing your media, scheduling recordings and so on. The web admin could become a real administration frontend. However, this is a much bigger task :)

I agree its an area that has long been in need of some new capabilities...its great to have someone looking into extending this side of the system

All the best

Andrew
Title: Re: Idea: Photo management
Post by: dlewis on May 22, 2009, 01:16:18 pm
GO FOR IT!!!!
Title: Re: Idea: Photo management
Post by: chriss on May 22, 2009, 02:11:52 pm
Well, I'm working on it  ;D Got my dev environment up, I'm able to compile UpdateMedia and currently I'm extending it to take care of exif data in jpg files... I'll keep you posted on how it goes.

/chriss
Title: Re: Idea: Photo management
Post by: dlewis on May 22, 2009, 02:20:15 pm
nice, thanks for the update!
Title: Re: Idea: Photo management
Post by: totallymaxed on May 23, 2009, 04:13:12 pm
Well, I'm working on it  ;D Got my dev environment up, I'm able to compile UpdateMedia and currently I'm extending it to take care of exif data in jpg files... I'll keep you posted on how it goes.

/chriss

Great :-)
Title: Photo management - mapping of attributes
Post by: chriss on May 24, 2009, 04:34:32 pm
Hi there,

got the reading of EXIF attributes working. Thanks to exiv2 lib it's quite easy ;)
Code: [Select]
10      05/24/09 16:20:38.175           Activating Pluto Media Identifier... <0xb6ac06c0>                           
10      05/24/09 16:20:38.176           Pluto Media Identifier activated. Extensions 27 <0xb6ac06c0>                 
10      05/24/09 16:20:38.176           MediaState::LoadDbInfo ready to run big query <0xb6ac06c0>                   
10      05/24/09 16:20:38.179           MediaState::LoadDbInfo got 2 rows <0xb6ac06c0>                               
10      05/24/09 16:20:38.179           UpdateMedia::ReadDirectory ./testdir <0xb6ac06c0>                           
10      05/24/09 16:20:38.180           UpdateMedia::ScanFiles dir ./testdir: files found: 1 <0xb6ac06c0>           
10      05/24/09 16:20:38.180           Need to update file because it's not in the database ./testdir/3.jpg <0xb6ac06c0>
10      05/24/09 16:20:38.180           Sync mode for ./testdir/3.jpg: modeBoth <0xb6ac06c0>                             
05      05/24/09 16:20:38.180           # PlutoMediaFile STARTED: dir ./testdir file 3.jpg <0xb6ac06c0>                 
10      05/24/09 16:20:38.180           # PhotoFileHandler::LoadAttributes: loading 0 attributes in the attribute file ./testdir/3.jpg <0xb6ac06c0>                                                                                                       
Exif.Image.Make                              0x010f Ascii      18  NIKON CORPORATION                                         
Exif.Image.Model                             0x0110 Ascii      11  NIKON D300                                               
Exif.Image.XResolution                       0x011a Rational    1  300/1                                                     
Exif.Image.YResolution                       0x011b Rational    1  300/1                                                     
Exif.Image.ResolutionUnit                    0x0128 Short       1  2                                                         
Exif.Image.Software                          0x0131 Ascii      28  Adobe Photoshop CS3 Windows                               
Exif.Image.DateTime                          0x0132 Ascii      20  2009:05:23 22:26:54                                       
Exif.Image.Artist                            0x013b Ascii      14  Janet Johnson                                             
Exif.Image.Copyright                         0x8298 Ascii      33  Copyright (C) 2009 Janet Johnson                         
Exif.Image.ExifTag                           0x8769 Long        1  276                                                       
Exif.Photo.ExposureTime                      0x829a Rational    1  1/320                                                     
Exif.Photo.FNumber                           0x829d Rational    1  11/1                                                     
Exif.Photo.ExposureProgram                   0x8822 Short       1  3                                                         
Exif.Photo.ISOSpeedRatings                   0x8827 Short       1  200                                                       
Exif.Photo.ExifVersion                       0x9000 Undefined   4  48 50 50 49                                               
Exif.Photo.DateTimeOriginal                  0x9003 Ascii      20  2009:05:23 15:16:28                                       
Exif.Photo.DateTimeDigitized                 0x9004 Ascii      20  2009:05:23 15:16:28                                       
Exif.Photo.ShutterSpeedValue                 0x9201 SRational   1  8321928/1000000                                           
Exif.Photo.ApertureValue                     0x9202 Rational    1  6918863/1000000                                           
Exif.Photo.ExposureBiasValue                 0x9204 SRational   1  0/6                                                       
Exif.Photo.MaxApertureValue                  0x9205 Rational    1  44/10                                                     
Exif.Photo.MeteringMode                      0x9207 Short       1  5                                                         
Exif.Photo.LightSource                       0x9208 Short       1  4                                                         
Exif.Photo.Flash                             0x9209 Short       1  0                                                         
Exif.Photo.FocalLength                       0x920a Rational    1  460/10                                                   
Exif.Photo.SubSecTimeOriginal                0x9291 Ascii       3  17                                                       
Exif.Photo.SubSecTimeDigitized               0x9292 Ascii       3  17                                                       
Exif.Photo.SensingMethod                     0xa217 Short       1  2                                                         
Exif.Photo.FileSource                        0xa300 Undefined   1  3                                                         
Exif.Photo.SceneType                         0xa301 Undefined   1  1                                                         
Exif.Photo.CFAPattern                        0xa302 Undefined   8  2 0 2 0 0 1 1 2                                           
Exif.Photo.CustomRendered                    0xa401 Short       1  0                                                         
Exif.Photo.ExposureMode                      0xa402 Short       1  0                                                         
Exif.Photo.WhiteBalance                      0xa403 Short       1  1                                                         
Exif.Photo.DigitalZoomRatio                  0xa404 Rational    1  1/1                                                       
Exif.Photo.FocalLengthIn35mmFilm             0xa405 Short       1  69                                                       
Exif.Photo.SceneCaptureType                  0xa406 Short       1  0                                                         
Exif.Photo.GainControl                       0xa407 Short       1  0                                                         
Exif.Photo.Contrast                          0xa408 Short       1  0                                                         
Exif.Photo.Saturation                        0xa409 Short       1  0                                                         
Exif.Photo.Sharpness                         0xa40a Short       1  2                                                         
Exif.Photo.SubjectDistanceRange              0xa40c Short       1  0                                                         
Exif.Thumbnail.Compression                   0x0103 Short       1  6                                                         
Exif.Thumbnail.XResolution                   0x011a Rational    1  72/1                                                     
Exif.Thumbnail.YResolution                   0x011b Rational    1  72/1                                                     
Exif.Thumbnail.ResolutionUnit                0x0128 Short       1  2                                                         
Exif.Thumbnail.JPEGInterchangeFormat         0x0201 Long        1  0                                                         
Exif.Thumbnail.JPEGInterchangeFormatLength   0x0202 Long        1  14557
10      05/24/09 16:20:38.208           MergePictures: merging 0 pictures from our tag with 0 pictures from PIC tags <0xb6ac06c0>
10      05/24/09 16:20:38.208           Processing path ./testdir, file 3.jpg. Found 0 attributes, 0 long attributes in file <0xb6ac06c0>

Now, the big question is how to do the attribute mapping. Please find a suggestion below. I listed all exif fields I would like to handle as well as a draft mapping to already existing AttributeType definitions. Any additions/changes you would like to see? All the other values will get their own AttributeType later on. BTW is there any problem with creating that much AttributeTypes?

Code: [Select]
ImageWidth
ImageLength
Orientation
DateTime -> Year
ImageDescription -> Title
Make
Model
Software
Artist -> Composer/Writer
UserComment
ExposureTime
FNumber
ExposureProgram
ISOSpeedRatings
ShutterSpeedValue
ApertureValue
BrightnessValue
ExposureBiasValue
MaxApertureValue
SubjectDistance
MeteringMode
LightSource
Flash
FocalLength
FlashEnergy
SceneCapturedType
GPSLatitude
GPSLongitude
GPSAltitude
GPSSpeed
GPSTrack
GPSImageDirection
GPSDestLatitude
GPSDestLongitude

br,
/chriss
Title: Re: Idea: Photo management
Post by: tschak909 on May 25, 2009, 12:16:40 am
What I would do, is keep in mind, that now that you're making photographs attribute searchable, the options popup (UI2) and screen (UI1_ can only hold at most 10 visible attributes, either to select, or to sort by. Narrow your attribute choices to the most common given that many maximum.

-Thom
Title: Re: Idea: Photo management
Post by: chriss on May 25, 2009, 06:27:17 am
Thom,

got that. But I think, a lot of this information is really useful when "managing" you photographs. On the other hand I would never use it to search photos from the frontend. I think we have to separate between the management which can easily be done on the backend, i.e. lmce admin or whatever, and the user interface of the frontend, i.e., orbiter.
This comes down to having only few attributes that need to be searchable or sortable by the frontend. Is there a way to exclude certain attributes from showing up on the orbiter? Maybe we could introduce another table field "hide_from_orbiter" or something?

/chriss
Title: Photo management - first patch
Post by: chriss on May 27, 2009, 06:33:32 pm
Hi there,

I'm ready to integrate the first working patch (reading and mapping four EXIF attributes to LMCE media attributes). Since this will add another dependency (libexiv2/libexiv2-dev) I don't dare to just commit the changes to not break the build process. What do I have to doe to properly include the dependency?

thanks,
/chriss
Title: Re: Idea: Photo management
Post by: tschak909 on May 27, 2009, 07:05:28 pm
Create a feature patch in trac, and attach the patch to it. Also make note of what packages are needed to be added to the package database so the builder can deal with them appropriately.

-Thom
Title: Re: Idea: Photo management
Post by: chriss on May 27, 2009, 08:37:28 pm
Okay, did that for now.

edit: Ticket #217, http://svn.linuxmce.org/trac.cgi/ticket/217
Title: Re: Idea: Photo management
Post by: chriss on July 13, 2009, 10:02:26 pm
Hi guys,

sorry for being quite for some time but unfortunately I can't spend as much time as intended...

I just wanted to make some changes to web admin to allow for modifying more than just the title attribute and discovered that there is a special table pluto_media.MediaType_AttributeType that controls which attributes can be added to a file. After making the changes I wanted to do a sqlCVS checkin, but... there is no pluto_media category in web admin and the web gui of schema.linuxmce.org does not contain any tables in the category media nor was I able to find the table in any of the other categories.

How can I get these changes into the build system? Maybe we have another mechanism to get these tables populated during install? Any hints?

thanks,
/chriss
Title: Re: Idea: Photo management
Post by: tschak909 on July 14, 2009, 12:29:38 am
you have to use sqlcvs manually on the command line to check them in.

You'll also need to specify -D pluto_media -r media on the command line.

Then you can check in changes via the menu.

-Thom
Title: Re: Idea: Photo management
Post by: chriss on July 14, 2009, 07:03:50 am
Thom, thanks for the hint, but it doesn't work:

Code: [Select]
dcerouter_113338:/home/chris# /usr/pluto/bin/sqlCVS -H schema.linuxmce.org -R 3999 -h localhost -a -D pluto_media -r media -t MediaType_AttributeType -d "root" -U "anonymous~nopass" -A -e diff
 Copyright (C) 2004 Pluto, Inc., a Florida Corporation
 www.plutohome.com
 Phone: +1 (877) 758-8648
This program is distributed according to the terms
of the Pluto Public License, available at:
 http://plutohome.com/index.php?section=public_license
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the Pluto Public License for more details.

-------

Database host:localhost user:root pass: name:pluto_media port:3306
Users:anonymous~nopass
Updating repository 'media' schema version from: 43
pk: 0 7pk: 1 16 psc_id: 0
changed row  psc_id: 0 has keys:2 7,  16,
pk: 0 7pk: 1 29 psc_id: 0
changed row  psc_id: 0 has keys:2 7,  29,
pk: 0 7pk: 1 37 psc_id: 0
changed row  psc_id: 0 has keys:2 7,  37,
pk: 0 7pk: 1 47 psc_id: 0
changed row  psc_id: 0 has keys:2 7,  47,
pk: 0 7pk: 1 48 psc_id: 0
changed row  psc_id: 0 has keys:2 7,  48,
DetermineDeletions for table: MediaType_AttributeType from psc_id: 57 batch: 0
Scanning range of psc_id: [0, 99999999] with interval_length=10000000
Cannot get table stats from server:-3
Caught exception: Communication error
dcerouter_113338:/home/chris#

I have no idea what's the actual problem. The syntax is correct since it works well with e.g. pluto_main/dce. I suspect that the tables are not hosted on the sever as said above (there are no tables listed for media in the sqlCVS web management gui).

Any hints from the sqlCVS gurus?

cheers,
/chriss
Title: Re: Idea: Photo management
Post by: tschak909 on July 14, 2009, 08:42:26 am
hmmm, anyone wanna get chriss some creds so he can edit the db on schema directly?

-Thom
Title: Re: Idea: Photo management
Post by: chriss on July 14, 2009, 09:11:55 am
editing db schema directly sounds dangerous  ::)

I'll try to get into the chat tonight. Maybe pos or hari are around and can assist me.

br,
/chriss
Title: Re: Idea: Photo management
Post by: Marie.O on September 16, 2009, 09:42:17 am
chriss,

would you mind updating the status of http://svn.linuxmce.org/trac.cgi/ticket/217

thx
Title: Re: Idea: Photo management
Post by: chriss on September 16, 2009, 10:55:06 am
Hi Pos,

here's some status feedback: I currently have some problems with my dev environment; some days ago UpdateMedia started producing segfaults somewhere in libc. It seems it has nothing to do with my modifications since it also happens with the current lmce-0810 branch version. Still trying to locate the problem and just set up a new dev environment as per wiki instructions. Some parts still fail to build, e.g., Orbiter, but I can continue work on UpdateMedia.
Will add a note to the ticket, too. Any deadlines to catch?

cheers,
/chriss
Title: Re: Idea: Photo management
Post by: colinjones on September 16, 2009, 10:44:00 pm
chriss - are you intending also to make some changes to the UI so that these new tags can be used? Sorting or filtering?
Title: Re: Idea: Photo management
Post by: Marie.O on September 16, 2009, 10:59:26 pm
Will add a note to the ticket, too. Any deadlines to catch?

Thanks for adding notes to the ticket. As the stuff is already in svn there are no deadlines to catch. Just move your stuff over into the branches part instead of your personal area.