Giter VIP home page Giter VIP logo

Comments (14)

kay-jahnke avatar kay-jahnke commented on July 25, 2024

Implemented the following Metadata for PDF-Files in commit c082f37 :

d['Title'] = 'Confocal Image'
d['Author'] = 'qudi - Software Suite'
d['Subject'] = 'Find more information on: https://github.com/Ulm-IQO/qudi'
d['Keywords'] = 'Python 3, Qt, experiment control, automation, measurement, software, framework, modular'
d['Producer'] = 'qudi - Software Suite'
d['CreationDate'] = timestamp
d['ModDate'] = timestamp

@drogenlied please specify what else you want saved. Other metadata are also possible, even if they are not specified in the standard.

It might make sense to also save the git-version. For now this is only implemented in the managergui (managergui: def getSoftwareVersion()). If you could move the function somewhere sensible, I could include that in the metadata.

from qudi.

kay-jahnke avatar kay-jahnke commented on July 25, 2024

Metadata for PNG seems quite tricky:

  • metadata is not standardised for PNG and most programs don't recognise it.
  • A simple way to add metadata is with the PIL package, which is not maintained anymore and causes more dependencies

Suggestion: No metadata for PNG.

from qudi.

drogenlied avatar drogenlied commented on July 25, 2024

The W3C specification explicitly mentions some standard metadata fields: https://www.w3.org/TR/PNG/#11textinfo

However, if it is not easy to convince matplotlib to use these, the suggestion still stands.

from qudi.

a-stark avatar a-stark commented on July 25, 2024

I also tried to embed a string representation of the measurement array of the data, which works very well, but which makes the pdf file a bit larger then usual (from 15kB to 17 kB for 100 data points), and after all the data could also be inferred from the metadata of the pdf file, which might facilitate eventually the data handling.

I would suggest an additional optional dictionary called 'metadata' which contains string keys and string values. This dictionary is passed as an optional argument to the save logic, which handles the save procedure of the pdf/png metadata.
As a first step, I would suggest to stick to the mentioned standard metadata fields for a png file like @drogenlied mentioned. We need to check whether an implementation without PIL is feasible.

from qudi.

kay-jahnke avatar kay-jahnke commented on July 25, 2024

Used the active branch Pillow (a fork of PIL) to insert metadata into png files.
The functionality is now working, but I had to extend the dependencies, which I tested and documented. Therefore I create a new branch, since I did not want to destroy any running environment.

Could you please merge the branch save-enhancement back to master, once you list qudi to a new version and have tested it.

Also, in the moment the metadata is static. If we want something dynamic, we should open a new issue and specify, what exactly we want.

from qudi.

a-stark avatar a-stark commented on July 25, 2024

I think that using Pillow is a reasonable idea, at least it seems that it is actively developed.

from qudi.

kay-jahnke avatar kay-jahnke commented on July 25, 2024

OK, lets call this issues resolved for now.

@drogenlied , @a-stark : How do we proceed? Do I just merge back to master, or will you merge back once you publish version 0.8 ton not break other people's dependencies?

from qudi.

drogenlied avatar drogenlied commented on July 25, 2024

People working with master can't really expect much more than a notice on breaking changes.
The more important point is updating the conda environment file, so the environment installation script installs the right thing.

from qudi.

kay-jahnke avatar kay-jahnke commented on July 25, 2024

This I have done.

So I merge back?

from qudi.

a-stark avatar a-stark commented on July 25, 2024

If I understand you correctly, you merged at first the master branch in your 'save enhancement' branch. If that was working well (i.e. you have tested the save methods), I do not see any problems in committing the changes to the master branch (merge your branch in master).

from qudi.

latchr avatar latchr commented on July 25, 2024

from qudi.

a-stark avatar a-stark commented on July 25, 2024

I would have one remark. Currently the title of the image is set to
d['Title'] = 'Confocal Image',
which is not true for all pictures. I know that we should open another issue for that (to implement the passing of metadata to savelogic), but until that, we could set a placeholder like
d['Title'] = 'Image produced by qudi'.

from qudi.

kay-jahnke avatar kay-jahnke commented on July 25, 2024

Will do that before I merge.

Give me a few more minutes.

from qudi.

kay-jahnke avatar kay-jahnke commented on July 25, 2024

solved in commit 9f37aa2 by merging the save-enhancement branch back into the master.

Please run an update of your conda environment in order to get all necessary dependencies.

from qudi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.