Page 1 of 2

Embedding Text in Images

Posted: 20 Nov 2014, 15:26
by alexhenes
It is my understanding that X3 will read and display text that is embedded in images.

Where exactly will X3 look for the text? What exif field(s).

I am writing a script that will take the text from my X2 xml file and embed them into my images.

Re: Embedding Text in Images

Posted: 20 Nov 2014, 23:57
by mjau-mjau
Image meta data is incredibly complex, because there is IPTC and EXIF, each with hundreds of options, and each manufacturer and application often setting them differently.

X3 currently uses 2 fields title and description from the image IPTC data. "Title" and "description" may be referred differently from other applications for example name, caption, documentTitle and more. X3 gets them by special codes reference (just so you know the actual codes):
Code
data['title'] = $iptc["2#005"][0];
data['description'] = $iptc["2#120"][0];
There is another option for setting titles and description, but we have not yet tested it properly or figured a way to implement it for editing. In each page, you can create a list of data for each image like this:
Code
filename.jpg:
  title: Image Title
  description: This is the description right here.
another.jpg:
  title: Nice Smile
  description: Watch the kids smile as the clown arrives.
Also, you are aware that you can rename any file to create its title? For example "our_trip_to_kansas.jpg" will display in the page as "Our Trip To Kansas".

We will extend this at some point, but for now the above information is all I can offer ...

Re: Embedding Text in Images

Posted: 21 Nov 2014, 00:06
by alexhenes
Thanks Karl... very helpful information.

I recall in a post a few months back you suggested embedding the descriptions into the image. Is this your recommend approach to descriptions in X3?

Re: Embedding Text in Images

Posted: 21 Nov 2014, 01:03
by mjau-mjau
alexhenes wrote:I recall in a post a few months back you suggested embedding the descriptions into the image. Is this your recommend approach to descriptions in X3?
Yes, and this is basically what I am referring to here:
mjau-mjau wrote:X3 currently uses 2 fields title and description from the image IPTC data. "Title" and "description" may be referred differently from other applications for example name, caption, documentTitle and more. X3 gets them by special codes reference (just so you know the actual codes):
Code
data['title'] = $iptc["2#005"][0];
data['description'] = $iptc["2#120"][0];
I just listed the codes in reference to the specific IPTC codes we are reading from the image, since you asked where exactly X3 looks for the text ...

The IPTC data can normally be populated with apps like iPhoto, Photoshop and a few more dedicated apps. We will add this functionality into the panel at some point, although I am not quite sure which method we will employ.

Re: Embedding Text in Images

Posted: 21 Nov 2014, 01:54
by alexhenes
thanks... very helpful!

on a related note... in the GUI... will X3 replace underscores in folder name with spaces?

Re: Embedding Text in Images

Posted: 21 Nov 2014, 02:10
by mjau-mjau
alexhenes wrote:on a related note... in the GUI... will X3 replace underscores in folder name with spaces?
X3 uses the TITLE from a folders settings. Only if title is not set (it should always be), then it would use the folder name and underscores would be replaced yes ... The folder name is not used in X3 pages, except for in the URL.

Re: Embedding Text in Images

Posted: 21 Nov 2014, 07:53
by winph
Code
filename.jpg:
  title: Image Title
  description: This is the description right here.
another.jpg:
  title: Nice Smile
  description: Watch the kids smile as the clown arrives.
what filename should i save this?

Re: Embedding Text in Images

Posted: 21 Nov 2014, 09:11
by mjau-mjau
winph wrote:what filename should i save this?
We are slightly ahead of ourselves here, but I did test that this works. From the panel, navigate to the page with the images ... In the page tab, you see a bunch of settings right? Basically you can just add them into page settings file so it would like something like this:
Code
title: Title here
label:
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
layout: 
context: 
folders: 
gallery: 
image:
filename.jpg:
  title: Image Title
  description: This is the description right here.
another.jpg:
  title: Nice Smile
  description: Watch the kids smile as the clown arrives.
content: |

Re: Embedding Text in Images

Posted: 21 Nov 2014, 20:29
by winph
Thanks. It work but can i still use the image: for "Preview image for the page, used in context layout and in sharing."
Code
image		: # Preview image for the page, used in context layout and in sharing.

btw if images starts with "_" it will not show up. Some of my images starts with underscore because of ADOBE RGB from canon system.

Re: Embedding Text in Images

Posted: 22 Nov 2014, 11:00
by mjau-mjau
winph wrote:Thanks. It work but can i still use the image: for "Preview image for the page, used in context layout and in sharing."
Yes, why not? This is for setting the page preview image, and does not have anything to do with setting image titles and descriptions.
winph wrote:btw if images starts with "_" it will not show up. Some of my images starts with underscore because of ADOBE RGB from canon system.
The _underscore applied in front of files in X3 and many other web applications, generally means _hidden. It is how we and you can prevent certain files and folders from being visible. Unfortunately, you will have to rename them ...

Re: Embedding Text in Images

Posted: 07 Dec 2014, 12:19
by alexhenes
one more general question...

Will Googlebot and other crawlers be able to read the text that is embedded within an image?

Re: Embedding Text in Images

Posted: 08 Dec 2014, 00:14
by mjau-mjau
alexhenes wrote:Will Googlebot and other crawlers be able to read the text that is embedded within an image?
Yes ... Bots and humans alike will see the text IN the website anyway, and it wouldn't even know if the text came from within the image or from a database. It is just the PHP backend that gets the data from the images own meta data and outputs it into the page ...

Re: Embedding Text in Images

Posted: 08 Dec 2014, 00:33
by alexhenes
Cool

Re: Embedding Text in Images

Posted: 14 Dec 2014, 20:43
by sprocket
mjau-mjau wrote:Image meta data is incredibly complex, because there is IPTC and EXIF, each with hundreds of options, and each manufacturer and application often setting them differently.

X3 currently uses 2 fields title and description from the image IPTC data. "Title" and "description" may be referred differently from other applications for example name, caption, documentTitle and more. X3 gets them by special codes reference (just so you know the actual codes):
Code
data['title'] = $iptc["2#005"][0];
data['description'] = $iptc["2#120"][0];
Hey Karl, I used the headline IPTC to automate the thousand of images in my X2 gallery and hope you would consider adding
Code
data['headline'] = $iptc["2#105"][0];
to that list of IPTC codes to be compatible with past features. I tested it and it works with my images.
Thanks Joe

Re: Embedding Text in Images

Posted: 14 Dec 2014, 23:36
by mjau-mjau
sprocket wrote:Hey Karl, I used the headline IPTC to automate the thousand of images in my X2 gallery and hope you would consider adding data['headline'] to that list of IPTC codes to be compatible with past features. I tested it and it works with my images.
Sure ... Adding that code above though does not make it work for you in X3 already though does it? I would assume you could hi-jack the title by using:
Code
data['title'] = $iptc["2#105"][0];
... because X3 will get the 'title', and you would have changed that to get the headline value of your image.

We need a good approach to this, as we can't just automatically add dozens of EXIF tags and display them all. The challenge is that different users and different cameras are using different IPTC/EXIF fields to set same/similar data (for instance title). We also need settings so the user can decide what EXIF options to display ... Will have to look into this at some point soon!