This question is answered. Helpful answers available: 0. Correct answers available: 1.


Permlink Replies: 59 - Pages: 4 [ Previous | 1 2 3 4 | Next ] - Last Post: 25-Jan-2017 07:44 Last Post By: Laza Threads: [ Previous | Next ]
ChuckT

Posts: 30
Registered: 6-Jan-2017
Re: Base Skin Pimped with a new init.bsh
Posted: 18-Jan-2017 17:38   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
I should have said "jGromit", sorry.

I will try commas.
jGromit

Posts: 33,207
Registered: 31-Jan-2006
Re: Base Skin Pimped with a new init.bsh
Posted: 18-Jan-2017 23:54   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
I don't know how to suppress the labels.

Actually, I do know how to suppress or change the labels, but it involves doing some very user-specific editing of the skin's template files.

Let's take the Iptc.By-Line as an example. Let's say that what you want it to display is:

Credit: NASA/Tony Gray

Instead of:

Iptc.By-Line: NASA/Tony Gray

To accomplish that, you could edit the skin's init.bsh file. The existing line # 198 is:
slideCaption = sb.toString();
You would insert, immediately below that:
slideCaption = slideCaption.replace("Iptc.By-Line", "Credit");
Repeat for the other metadata fields whose labels you want to change. You could, of course, eliminate the label by making the replacement text an empty string:
slideCaption = slideCaption.replace("Iptc.By-Line", "");
ChuckT

Posts: 30
Registered: 6-Jan-2017
Re: Base Skin Pimped with a new init.bsh
Posted: 19-Jan-2017 15:26   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Thank you.
The commas seem to work.

I will try your editing suggestion to suppress the Iptc label text today.

cvt
ChuckT

Posts: 30
Registered: 6-Jan-2017
Re: Base Skin Pimped with a new init.bsh
Posted: 19-Jan-2017 17:26   in response to: ChuckT in response to: ChuckT
 
  Click to reply to this thread Reply
I found that string slideCaption = sb.toString(); at line #203
And inserted these:

slideCaption = slideCaption.replace("Iptc.By-Line","Photo Credit");
slideCaption = slideCaption.replace("Iptc.Date Created","Shoot Date");
slideCaption = slideCaption.replace("Iptc.Keywords","");
slideCaption = slideCaption.replace("Iptc.Sub-location","Location");

your text looks to have a space after the comma as <"> is that necessary?
I made all 5 lines begin with the same indent
and the ending semi-colon doesn't have a space after it

good? do you think?
ChuckT

Posts: 30
Registered: 6-Jan-2017
Re: Base Skin Pimped with a new init.bsh
Posted: 19-Jan-2017 17:29   in response to: ChuckT in response to: ChuckT
 
  Click to reply to this thread Reply
Hmm this is what i see:
Image Description Employee of the Month/Quarter · Iptc.By-line NASA/Tony Gray · Shoot Date Wed Jan 04 00:00:00 EST 2017 · Work Order # 3138431 · Location KSC Headquarters building, rear

So some are working
jGromit

Posts: 33,207
Registered: 31-Jan-2006
Re: Base Skin Pimped with a new init.bsh
Posted: 19-Jan-2017 17:37   in response to: ChuckT in response to: ChuckT
 
  Click to reply to this thread Reply
The spacing of the code doesn't matter - I just do some things for readability.

The text is case-sensitive: Iptc.By-line and Iptc.By-Line are not equal. ;)
ChuckT

Posts: 30
Registered: 6-Jan-2017
Re: Base Skin Pimped with a new init.bsh
Posted: 19-Jan-2017 17:45   in response to: ChuckT in response to: ChuckT
 
  Click to reply to this thread Reply
Tried this:
(all begin with a leading tab for spacing)
slideCaption = sb.toString();
slideCaption = slideCaption.replace("Image Description","");
slideCaption = slideCaption.replace("Iptc.By-line","");
slideCaption = slideCaption.replace("Iptc.Date Created","");
slideCaption = slideCaption.replace("Iptc.Keywords","");
slideCaption = slideCaption.replace("Iptc.Sub-location","");

The only line that seems to work is "Iptc.Keywords",""

drat
jGromit

Posts: 33,207
Registered: 31-Jan-2006
Re: Base Skin Pimped with a new init.bsh
Posted: 19-Jan-2017 18:07   in response to: ChuckT in response to: ChuckT
 
  Click to reply to this thread Reply
Attach just one image that has those IPTC fields in it, so I can play with it.
ChuckT

Posts: 30
Registered: 6-Jan-2017
Re: Base Skin Pimped with a new init.bsh
Posted: 19-Jan-2017 18:58   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
First image
jGromit

Posts: 33,207
Registered: 31-Jan-2006
Re: Base Skin Pimped with a new init.bsh
Posted: 19-Jan-2017 19:11   in response to: ChuckT in response to: ChuckT
 
  Click to reply to this thread Reply
Attachment ss002511.png (183,2 KB)
Seems to be working for me. In the Base slide page settings, I've defined the photo data I want as follows:
Image Description, Iptc.By-line, Iptc.Date Created, Iptc.Keywords, Iptc.Sub-location
Then in the skin's init.bsh file, after line 198, I've inserted:
	slideCaption = slideCaption.replace("Image Description", "Description:");
	slideCaption = slideCaption.replace("Iptc.By-line", "Credit:");
	slideCaption = slideCaption.replace("Iptc.Date Created", "Date:");
	slideCaption = slideCaption.replace("Iptc.Keywords", "Keywords:");
	slideCaption = slideCaption.replace("Iptc.Sub-location", "Location:");
What I get is what you see in the screenshot.
jGromit

Posts: 33,207
Registered: 31-Jan-2006
Re: Base Skin Pimped with a new init.bsh
Posted: 19-Jan-2017 19:14   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
BTW, standard advice whenever you're tinkering.... Do not tell jAlbum to process only updated subdirectories under Album > Settings > Advanced > General (changing settings isn't an "update"), and always refresh your browser cache when looking at the page (CTRL-F5).
jGromit

Posts: 33,207
Registered: 31-Jan-2006
Re: Base Skin Pimped with a new init.bsh
Posted: 19-Jan-2017 19:28   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
(To my fellow coders out there... Yes, I know this could be a one-liner, or perhaps a nice little array with a "for" loop, but I'm trying to keep this easy to understand and maintain. ;) )
ChuckT

Posts: 30
Registered: 6-Jan-2017
Re: Base Skin Pimped with a new init.bsh
Posted: 19-Jan-2017 19:35   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Well I'm convinced it's me not being conversant with bash

I see that your lines read:
slideCaption = slideCaption.replace("Iptc.Sub-location", "Location:"); with a space between at the comma reading <quote character><comma><space><quote character>.

Does not having that space, a syntax error, change things?
jGromit

Posts: 33,207
Registered: 31-Jan-2006
Re: Base Skin Pimped with a new init.bsh
Posted: 19-Jan-2017 19:43   in response to: ChuckT in response to: ChuckT
 
  Click to reply to this thread Reply
Spaces and tabs have no syntactical meaning in Java or BeanShell (unless they're within a quoted string, of course). It's just a matter of style - I find lines easier to read when comma-separated things have spaces after each item.

Try just copying and pasting what I've posted.
ChuckT

Posts: 30
Registered: 6-Jan-2017
Re: Base Skin Pimped with a new init.bsh
Posted: 19-Jan-2017 19:50   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
"BTW, standard advice whenever you're tinkering.... Do not tell jAlbum to process only updated subdirectories under Album > Settings > Advanced > General (changing settings isn't an "update"), and always refresh your browser cache when looking at the page (CTRL-F5)."

I was not doing that.
After altering init.bsh I'd save it and exit the editor
If I still had the images up I'd go back from Preview to Explore, check to see my changes were in init.bsh close the editor again, File-Save as default and re-Preview

Under Album > Settings > Advanced > General(tab) I do not see an "update" . I do see "OK" and "Apply".

Under Album > Settings > Advanced there is a "Process only updated subdirectories" it is un-checked.

When you say "refresh your browser cache when looking at the page (CTRL-F5)." You are talking about the jAlbum program window, I think. No I have not refreshed it with that command.

Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums