Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an app to manage the meta data stored in media files #550

Closed
oparoz opened this issue Mar 2, 2016 · 11 comments
Closed

Create an app to manage the meta data stored in media files #550

oparoz opened this issue Mar 2, 2016 · 11 comments

Comments

@oparoz
Copy link
Contributor

oparoz commented Mar 2, 2016

GSoC 2016

ETA: August 2016
Student: Jalpreet Singh Nanda (@imjalpreet)
Project: https://github.com/interfasys/mediametadata

Description

Media files can contain extra information embedded in the header. The goal is to extract that information at upload time and to store it in the database so that it can be used later for sorting or to give users more information about their files.

It will also be possible to manipulate the information so that users can change the image's rotation, description, etc.

Collecting information

  1. Any file operation generates events, propagated via the Hooks system. Our app needs to register as a listener of a selection of events
  2. When receiving an event, the app will need to parse the information and store it

Retrieving the information

Any app can test for the presence of this new app and then retrieve the information straight from the database.

The alternative is to use a REST API, but this might slow down operations as it requires making an additional HTTP request every time the consumer needs to get information about media files

A 3rd option is to create services which can be re-used by other apps, but app-interdependency is frowned upon. If it is determined that for performance reason this is the best option. A solution will be found. At the last resort, we could integrate the services inside Gallery, making them exclusively available to this app.

Writing information to an image

This is quite similar to retrieving information, but will generally be done one image at a time, so using a REST API sound like a good solution

Benefit / value

This can then be used for:

  • sorting by date taken as opposed to date uploaded
  • sorting by colour (Exif data)
  • sorting by size
  • sorting by person (Exif data)
  • virtual views. Date based albums, tags based albums, location based albums, etc Flat view - all images in current and sub-directories #95
  • modifying the metadata linked to an image

Risk / caveats

It creates a dependency between Gallery and the metadata app, because if the metadata app's API changes, features will stop working in Gallery.

Specifications

Requirements

  • Parsers/writers for XMP, IPTC, EXIF
  • Stores the information in both its own and existing ownCloud (tags) table(s)
  • Collects the information at upload time (GUI, WebDAV)
  • CRUD operations
  • (Optional) Video files parser to detect HTML5 compatibility

Implementation

  • MetaDataService
  • Parsers/writers in folder "metadata"
  • Use Hooks to keep the information up to date

Documentation

Sponsorship

GSOC 2016

@harshjv
Copy link

harshjv commented Mar 21, 2016

Hello, I would like to work on this issue for GSoC.

PHP already have support for IPTC and EXIF data through iptcparse and exif_read_data respectively. But has no built-in support for XMP data.

But as XMP data is present in XML format, basic parsing can be done by looking for <x:xmpmeta and </x:xmpmeta> in the image.

I also have an idea to handle the rest of the issue. I'll be submitting a proposal for the project soon.

@oparoz
Copy link
Contributor Author

oparoz commented Mar 21, 2016

But as XMP data is present in XML format, basic parsing can be done by looking for <x:xmpmeta and </x:xmpmeta> in the image.

Indeed and if that doesn't exist as a composer library yet, it could be written by the student.

@harshjv
Copy link

harshjv commented Mar 21, 2016

@oparoz sure! I found this https://github.com/mermshaus/kaloa-xmp. It reads XMP metadata from the image.

@oparoz
Copy link
Contributor Author

oparoz commented Mar 21, 2016

@harshjv - Cool :)

@imjalpreet @harshjv - I've updated the OP to try and give more information on how this could work.

@harshjv
Copy link

harshjv commented Mar 21, 2016

@oparoz Thanks 😄

I have created a sample app to store image's width and height when it is uploaded using Hooks and Node API. Source code: https://github.com/harshjv/owncloud-imagesize-app

@oparoz
Copy link
Contributor Author

oparoz commented Mar 21, 2016

Thanks! I'm going to report back in your app's repo directly

@harshjv
Copy link

harshjv commented Mar 23, 2016

It seems that if metadata service is added to Gallery then due to the part of Gallery app, the service will be limited to the media provided by the Gallery app.

Instead, what about a separate application just for handling metadata and storing it to database and make the data available to other apps as a service? If this solution is considered then the app can be extended to collect metadata of media other than images, such as audio and video.

What do you think? @oparoz

@oparoz
Copy link
Contributor Author

oparoz commented Mar 24, 2016

The 1st thing to resolve when working on this project will indeed be the location of the services. Apps should not depend on other apps, but by making the dependency optional and having a stable API, we could make it work by creating a metadata app which offers its services to any app needing to extract and/or write meta data to media files.
This will have to be discussed with the core team. I'm trying to avoid to bloat Gallery with services which not everybody will use, but this is pretty central to the way a multimedia app works, so not a big problem to include, just a shame for other apps.

@harshjv
Copy link

harshjv commented Mar 24, 2016

Yes, first the location of the service should be decided. If a separate app is developed, It will keep Gallery app away from being bloated. This way, an independent app can be made available for metadata as a service.

@hna61
Copy link

hna61 commented Aug 12, 2016

Would it be possible to manage the meta data in a separate .xmp file?
That would be of great benefit (at least for me): keep the valuable media file untouched but change meta data by changing the contents of the accompanied xmp-file.

@oparoz
Copy link
Contributor Author

oparoz commented Sep 4, 2016

This issue was moved to nextcloud/gallery#120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants