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


Permlink Replies: 7 - Pages: 1 - Last Post: 20-Jan-2020 22:22 Last Post By: JeffTucker
robbif

Posts: 7
Registered: 15-Oct-2008
Saturn: Error Including PDF
Posted: 19-Jan-2020 21:45
 
  Click to reply to this thread Reply
Jeff,

I've tried several options to display a PDF: Html target="blank" (which doesn't open in a new tab/window, whether I check the box in Layout/Index Page or not. So I placed the PDF in the Image Directory and got the error below.

Help will be appreciated.

Thanks!

Stack trace for jAlbum 19.2 using skin Saturn 30:

se.datadosen.util.ScriptException: javax.script.ScriptException: Sourced file: inline evaluation of: ``cc = JAlbumUtilities.countCategories(currentFolder, false); anyFoldersThisdir = . . . '' : Void assignment. : at Line: 54 : in file: inline evaluation of: ``cc = JAlbumUtilities.countCategories(currentFolder, false); anyFoldersThisdir = . . . '' : thisHeight = othericonH
in predir.bsh at line number 54
at se.datadosen.util.ScriptException.of(ScriptException.java:59)
at se.datadosen.jalbum.AlbumBean.processScript(AlbumBean.java:2480)
at se.datadosen.jalbum.AlbumBean.makeAlbumForFolder(AlbumBean.java:1473)
at se.datadosen.jalbum.AlbumBean.makeAlbum(AlbumBean.java:2755)
at se.datadosen.jalbum.AlbumBean.smartMakeAlbum(AlbumBean.java:2667)
at se.datadosen.jalbum.JAlbumFrame$6.run(JAlbumFrame.java:1123)
Caused by: javax.script.ScriptException: Sourced file: inline evaluation of: ``cc = JAlbumUtilities.countCategories(currentFolder, false); anyFoldersThisdir = . . . '' : Void assignment. : at Line: 54 : in file: inline evaluation of: ``cc = JAlbumUtilities.countCategories(currentFolder, false); anyFoldersThisdir = . . . '' : thisHeight = othericonH
in inline evaluation of: ``cc = JAlbumUtilities.countCategories(currentFolder, false); anyFoldersThisdir = . . . '' at line number 54
at bsh.BshScriptEngine.evalSource(BshScriptEngine.java:96)
at bsh.BshScriptEngine.eval(BshScriptEngine.java:57)
at java.scripting/javax.script.AbstractScriptEngine.eval(Unknown Source)
at se.datadosen.jalbum.AlbumBean.doProcessExpression(AlbumBean.java:2530)
at se.datadosen.jalbum.AlbumBean.processExpression(AlbumBean.java:2522)
at se.datadosen.jalbum.AlbumBean.processScript(AlbumBean.java:2478)
... 4 more

JeffTucker

Posts: 6,979
Registered: 31-Jan-2006
Re: Saturn: Error Including PDF
Posted: 19-Jan-2020 22:20   in response to: robbif in response to: robbif
 
  Click to reply to this thread Reply
Attachment predir.bsh (4,8 KB)
Interesting bug - I'm not sure how that one snuck in there (it's cross-pollution from a different skin, but that's my fault, not yours). It occurs only with non-fixed-shape thumbnails. Open the skin directory and replace predir.bsh with the attached version, and see how that behaves.

Don't monkey around with the HTML. Just add the PDF to the project, just as you would add an image. The setting Saturn > Layout > Index Page > Navigation > Open PDF's in a new window will control whether it opens in a lightbox or not.

BTW, you can add the PDF along with a same-name THM file if you want to have a thumbnail with an image instead of the generic PDF icon.
robbif

Posts: 7
Registered: 15-Oct-2008
Re: Saturn: Error Including PDF
Posted: 20-Jan-2020 01:49   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
It almost worked. It didn't crash. The comment did not appear under the PDF. I don't think it opened in a new window/tab but it opened.
Then I deleted 2-3 images that were used instead of the PDF, tried to Make Album, saw a message something like "To save space, select Delete Album". I ignored it, and the resulting output album was a mess, all images out of order, comments gone a bunch of subfolders generated. Explore looked fine: all images there, all in order, all comments OK etc. I tried remaking the album with the same results. I deleted the entire output directory and remade the album again with the same result. I deleted the PDF and still same results.
JeffTucker

Posts: 6,979
Registered: 31-Jan-2006
Re: Saturn: Error Including PDF
Posted: 20-Jan-2020 03:03   in response to: robbif in response to: robbif
 
  Click to reply to this thread Reply
robbif wrote:
It almost worked. It didn't crash.

That means the skin is working.

The comment did not appear under the PDF.

The PDF is an album object just like any other. If you enter a comment for it, and tell the skin to display the comment, it will be shown. There is no "special" processing for a PDF that's different in some way.

I don't think it opened in a new window/tab but it opened.

If it opens in a new tab, then there will nothing "jAlbum" or "Saturn" about it. With that option, you're just telling the browser to display the PDF. There will be no jAlbum title or comment, no Saturn navigation - in short, it's just the raw PDF, being shown by the browser.

Then I deleted 2-3 images that were used instead of the PDF, tried to Make Album, saw a message something like "To save space, select Delete Album". I ignored it, and the resulting output album was a mess, all images out of order, comments gone a bunch of subfolders generated. Explore looked fine: all images there, all in order, all comments OK etc. I tried remaking the album with the same results. I deleted the entire output directory and remade the album again with the same result. I deleted the PDF and still same results.

I'm sorry, but I just don't understand what you're doing. The skin plays no role in sorting the images, and I have no idea where the "To save space" message is coming from - I don't think I've ever seen it. But I have a suspicion that you have several objects in the project that have the same base name, like mydog.pdf and mydog.jpg. That will always result in chaos. You simply can't do that in jAlbum.

It's time to start over. Start a new project. Select Saturn. Add a few images, and one PDF. Make the album and preview it. Is everything working?

Now, to associate an image with a PDF.... Let's say the PDF is mydog.pdf. Choose an image you want to use for it, and outside of jAlbum, name that file mydog.jpg. Then change the name to mydog.thm. Your operating system will complain about this, because it doesn't know what you're doing. Don't worry about it. Back in jAlbum, just add mydog.pdf and mydog.thm to the project - together, at the same time. Make the album and preview it.
robbif

Posts: 7
Registered: 15-Oct-2008
Re: Saturn: Error Including PDF
Posted: 20-Jan-2020 12:31   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I did have some almost-dupiicate named files which I deleted but I still have a mess . I guess I will have to start over. All of my exclude flags are gone and the images are in some random order.

I don't understand that the skin has nothing to do with the sorting order. Still...
In Explore, all my files (with their unique filenames) are still shown in the correct order I created with Saturn, yet the generated album now shows them all out of order. So somewhere that order mapping must be generated and saved by jAlbum/Saturn (along with the exclude tags) but is corrupted when the album is made. Where is that information stored and can I recover any of it?

Thanks as always!
JeffTucker

Posts: 6,979
Registered: 31-Jan-2006
Re: Saturn: Error Including PDF
Posted: 20-Jan-2020 13:16   in response to: robbif in response to: robbif
 
  Click to reply to this thread Reply
robbif wrote:
I did have some almost-dupiicate named files which I deleted....

Almost duplicate is OK. Exact base-name duplicates are a disaster. The reason is simple. Imagine you have mydog.jpg, mydog.mp4, and mydog.pdf. When you make the album, jAlbum has to make a thumbnail image for each one. And each one produces thumbs/mydog.jpg as its thumbnail. The only one you end up with is the last one it makes, since all three objects produce the same thumbnail name. It gets even worse in a skin that has separate slide pages (Saturn does not), each of which ends up as slides/mydog.html.

I don't understand that the skin has nothing to do with the sorting order.

I promise you, there is not a single line of code in Saturn that would reorder the images. It takes them in the order that jAlbum feeds them to it. (There are almost no skins that do any reordering - doing so would require an extraordinary amount of extra coding.)

In Explore, all my files (with their unique filenames) are still shown in the correct order I created with Saturn, yet the generated album now shows them all out of order.

I would have to see this to believe it, since it would require divine intervention. Please upload the "messed up" album to some temporary location, and give me a link to it. Make sure you include the lifeboat file - see Tools > Preferences > Album > Include lifeboat file. That file includes information that I must have to figure out what's happening.
robbif

Posts: 7
Registered: 15-Oct-2008
Re: Saturn: Error Including PDF
Posted: 20-Jan-2020 18:28   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Sending you 2 links via email.
First one is the last version that's almost OK.
Second is the worst case.
In both cases, Explore showed all images in the correct order with proper excludes.

EDIT: Looks like I'm back on track, starting only slightly behind. Didn't have to sart from scratch. Have to reorder and add excludes back. PDF is in and I'll be adding the THM you recommended. New predir.bsh is in place.

I'd still like to know if you can (easily) find what went wrong.

Thanks!

Edited by: robbif on 20-Jan-2020 12:28

Edited by: robbif on 20-Jan-2020 13:42
JeffTucker

Posts: 6,979
Registered: 31-Jan-2006
Re: Saturn: Error Including PDF
Posted: 20-Jan-2020 22:22   in response to: robbif in response to: robbif
 
  Click to reply to this thread Reply
We may never know. Your "mess" album looks absolutely correct. The sequence of files (which is stored in the albumfiles.txt file) matches the sequence of images in the album, and there's no reason why the jAlbum Explore view would show you anything different. The default ordering in jAlbum sometimes produces a faulty sequence, but a quick F5 straightens that out, as does simply closing and re-opening the project.

There is one hint, however, in the output files in that album. It looks as if somewhere along the line, you managed to get to Settings > Structure, and you chose Alphabetical. What this does is put all of the images into folders, by alphabet. So in the finished album, there would be an A folder with all the images whose names start with "a," then a B folder with the images whose names start with "b," and so on. I suspect it was this misadventure that produced an album with a very puzzling sequence of images.
Legend
Forum admins
Helpful Answer
Correct Answer

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