Archive

Posts Tagged ‘media’

Merged branch phtagr-media-schema

April 25th, 2009 Comments off

The branch phtagr-media-schema was merged to the trunk successfully. The new database schema fits more the database relation between files and media and changes the model Image to the model Media.

Upgrade your phTagr instance

The database must be upgraded to the new schema. However, the new merged trunk comes with a handy shell script upgradeMediaSchema which handles the database upgrade and data migration. Update your phtagr code of trunk via svn and change to your phtagr directory and execute the shell script by ‘../cake/console/cake -app phtagr upgradeMediaSchema upgrade


phtagr$ svn up
phtagr$ ../cake/console/cake -app phtagr upgradeMediaSchema
Schema Upgrade Shell Script for Media Schema
---------------------------------------------------------------
Help screen
---------------------------------------------------------------
upgrade
    Upgrade schema to media schema
---------------------------------------------------------------
phtagr$ ../cake/console/cake -app phtagr upgradeMediaSchema upgrade
Schema Upgrade Shell Script for Media Schema
---------------------------------------------------------------
Prepare upgrade...
Upgrade schema...
Migrate 132 media...
Finalizing upgrade...
All done. Enjoy!
phtagr$

Reasons for a new Schema

The old schema uses only one table for a image/media which includes also the file information. Since a media is not only restricted to one file, this schema does not model the reality well. E.g. a media could be a video and the video thumb file or an image with a sound memo attached to it. Since now, phTagr uses also the term media instead of image.

The new schema splits the old table images to the table media and table files while the model Media gets a HasMany relation to the model File.

Other changes

The merge comes also with an improved import functionality. phTagr has now a Filter Manger which handles the import and export of a media and/or metadata. Currently there are three different filters:

  • Image Filter (JPEG)
  • Video Filter (AVI, MOV, MPEG, THM)
  • GPS Filter (LOG)

New filters could be implemented more convenient (e.g. a Sound Filter which attaches a sound memo to a media). The Filter Manager supports a priority based import that a video thumbnail is read after the video file.