Code Monkey home page Code Monkey logo

Comments (19)

rprieto avatar rprieto commented on May 18, 2024

Nice one @dravenst, thanks for looking into it! I'll add this in soon.
Do you have a a few photos with IPTC captions for testing?

from thumbsup.

dravenst avatar dravenst commented on May 18, 2024

Here is a sample with caption "Pretty canyon view" in it.  You can see it in Infranview (under Information->IPTC).
Thanks,-Rob

 On Saturday, December 27, 2014 2:47 AM, Romain Prieto <[email protected]> wrote:

Nice one @dravenst, thanks for looking into it! I'll add this in soon.
Do you have a a few photos with IPTC captions for testing?—
Reply to this email directly or view it on GitHub.

from thumbsup.

brentrobbins avatar brentrobbins commented on May 18, 2024

@dravenst is there any chance you would roll this feature into thumbsup?

from thumbsup.

rprieto avatar rprieto commented on May 18, 2024

Sorry, dropped the ball on that one! Did I miss the link to the example file?

It should be relatively straight forward to integrate, with the code that @dravenst wrote (although thumbsup uses graphicsmagick, but I imagine it has similar capabilities).

from thumbsup.

brentrobbins avatar brentrobbins commented on May 18, 2024

Unfortunately I am not nodejs programer or I would try, but I can send you these test images with caption data to test.

nature-q-c-800-600-3
nature-q-c-800-600-4
nature-q-c-800-600-5

from thumbsup.

dravenst avatar dravenst commented on May 18, 2024

I did create a fork with some new options including the feature to read captions from the image files.

from thumbsup.

rprieto avatar rprieto commented on May 18, 2024

Sorry I was unavailable for the last 2 months. That's awesome @dravenst, is it something we can easily merge back in?

from thumbsup.

rprieto avatar rprieto commented on May 18, 2024

@dravenst I just added EXIF caption support on master. You can have a look over here: http://rprieto.github.io/thumbsup/captions.html

It works well on the photos @brentrobbins provided. Would you mind pasting a photo with IPTC headers, to make sure we can cover both cases? Thanks!

from thumbsup.

rprieto avatar rprieto commented on May 18, 2024

Broader question: should we always display captions, or should it be an option?

Also adding an idea from #14: we could default the caption to the file name if no EXIF/IPTC caption is found. Or should that be optional too? (i.e. we actually want it to stay blank sometimes).

Suggesting

--show-captions [true|false]
--default-captions [true|false]

from thumbsup.

brentrobbins avatar brentrobbins commented on May 18, 2024

@rprieto I think it might be nice to have it as an option, but one enhancement I would recommend would be using the captions for the image alt tags.

from thumbsup.

rprieto avatar rprieto commented on May 18, 2024

Good idea, thanks! So here's the current TODO list:

  • add support for EXIF captions
  • update metadata.json with the captions so they're only parsed once (not on every build)
  • display captions under the photo in full screen mode
  • add support for IPTC captions (which Picasa uses)

from thumbsup.

rprieto avatar rprieto commented on May 18, 2024

Fixed in 3a01c67.

IPTC captions are always shows if present, which is the same behaviour as EXIF captions. Some new themes could do it differently later, e.g. showing the caption underneath every thumbnail.

Some nice to have for later:

  • have an option for the full screen viewer to display the filename if there is no caption
  • use the caption for the image alt tag

from thumbsup.

dkebler avatar dkebler commented on May 18, 2024

Looks like this was included in a recent tagged release for npm but I just installed thumbsup from npm ( 2.0 alpha 4) and there is no caption options on the CLI nor captions showing. Does it look for XMP, EXIF or IPTC metadata or only IPTC?

For those reading this....I added description/caption to each one and the only one appearing was EXIF.
Is there a css class for stying this?

from thumbsup.

rprieto avatar rprieto commented on May 18, 2024

That's odd, it should be picking up both EXIF and IPTC captions (ImageDescription and Caption-Abstract respectively). I'll have a look to see if something broke here. Thanks for raising the issue!

from thumbsup.

rprieto avatar rprieto commented on May 18, 2024

From a quick test, it seems to be working well for both EXIF and IPTC. To clarify the behaviour, it shows captions in the "viewer" mode (when scrolling through large photos). Is that where you're looking, or did you expect them under the thumbnails? There is no CLI argument needed.

from thumbsup.

dkebler avatar dkebler commented on May 18, 2024

Yes I double checked my test image has also an IPTC tag Caption-Abstract set as well. So according to what you wrote I should be seeing both? or do if find the exif it ignore iptc?

As to styling. I figured out the lg class, but you have viewer.css loaded before ligthgallery.css. I suggest you move it and styles.css to after lightgallery.css so one can customize. Until I did that .lg-sub-html class changes in viewer.css were ignored. If your intention was not to have users change that file I'd add another custom.css to the end of the imports.

from thumbsup.

dkebler avatar dkebler commented on May 18, 2024

Ok, yes, IPTC Caption-Abstract is working. As you say. I deleted my exif tag and then it displayed the iptc one. So all is good.

@rprieto On this same caption topic. Have you seen fgallery? https://github.com/wavexx/fgallery

It uses xmp data and displays a title and description nicely formatted... There are better photo tagger programs out there for xmp then for exif/IPTC. I suppose it wouldn't be too hard to allow custom captions where user specifies which custom xmp tags they want to use with defaults of "title" and "caption" like fgallery uses.

from thumbsup.

rprieto avatar rprieto commented on May 18, 2024

I didn't know about fgallery, I will check it out thanks! Seems similar in concept so it will be good to see what options it has and get ideas for improvements :)

Regarding the caption, you're right that Title is a valid IPTC field. (EDIT: actually XMP). I'd say we should read that field as well, and display whichever one of the 3 exists. Do you want to submit a PR in input/file.js (or model/media.js after #58 is merged)?

Your idea of an option to specify which tags to use could be useful too, as a separate feature. Only limitation is that thumbsup is heavily based in exiftool so we'd need to see if exiftool-json-db loads custom tags or not. Another option is to follow the principle of least surprise, and try to read the caption from as many fields as make sense, e.g. also checking IPTC:Headline, etc. That might be an easy step to start with.

from thumbsup.

rprieto avatar rprieto commented on May 18, 2024

@dkebler the last update on master reads the caption from all standard EXIF/IPTC/XMP tags. For now it only has a single "caption", which could be split at some point into title/description as you suggested - maybe after revisiting what the UI should look like.

from thumbsup.

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.