Thread Locked This thread is locked - replies are not allowed.


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


Permlink Replies: 6 - Pages: 1 - Last Post: 19 Apr 23, 16:50 Last Post By: RobM Threads: [ Previous | Next ]
RobM

Posts: 4,047
Registered: 4-Aug-2006
Bundled projects and other skins
Posted: 19 Apr 23, 11:31
 
This is repeatable and happens with jAlbum 29.2.4 and later, earlier versions work normally.

Load the sample project and then choose a skin other than Tiger, Neptune and Missive for example. Ensure there is no output album. Now try to make the album, you get errors.

Neptune album’s res folder fails to contain all of the required icon SVG files.

With Missive I got an error indicating that the album’s res folder was not correctly made, in fact the ‘folder’ was a copy of the htt.png image. Checking the res ‘folder’ with Exiftool confirms this.

robert@Robert-Mac ~ % exiftool /Users/robert/My\ Albums/Sample\ Project/album/res
ExifTool Version Number : 12.51
File Name : res
Directory : /Users/robert/My Albums/Sample Project/album
File Size : 4.6 kB
File Modification Date/Time : 2023:03:09 20:35:55+00:00
File Access Date/Time : 2023:04:18 23:11:16+01:00
File Inode Change Date/Time : 2023:04:18 23:11:16+01:00
File Permissions : -rw-r--r--
File Type : PNG
File Type Extension : png
MIME Type : image/png
Image Width : 320
Image Height : 320
Bit Depth : 8
JeffTucker

Posts: 8,492
Registered: 31-Jan-2006
Re: Bundled projects and other skins
Posted: 19 Apr 23, 14:04   in response to: RobM in response to: RobM
 
In Neptune, the error shows up as a string of console errors, all involving the creation of color-matched SVG files. It can't write to res because it apparently doesn't exist yet. Of course, the output res should exist before any skin processing is started. The only reason it doesn't actually crash is that the routines in Neptune are in try/catch blocks.

I even got a crash with Minimal once. The error message complained that album didn't exist. Yikes.

Strangely, I can't reproduce the error by simply creating a new Tiger album, not making the album, but then changing to another skin. For some reason that I haven't figured out, it's the Sample Project that triggers this.
davidekholm

Posts: 4,000
Registered: 18-Oct-2002
Re: Bundled projects and other skins
Posted: 19 Apr 23, 15:38   in response to: JeffTucker in response to: JeffTucker
 
I can't reproduce this consistently, but I've seen it happening. I believe I've fixed it in v30.2.2 now (core update).

Some skins assume that the "res" folder exists when processing the init file. That's not guaranteed. v30.2.2 now creates that folder if the target of a IO.copyFile() operation ends in a slash, for instance ...res/.

If the target doesn't end in a slash, it's assumed to be a file name
JeffTucker

Posts: 8,492
Registered: 31-Jan-2006
Re: Bundled projects and other skins
Posted: 19 Apr 23, 15:59   in response to: davidekholm in response to: davidekholm
 
That gets rid of the console errors and missing SVG icons in my skins - my copyFile()'s have a slash at the end of the destination. FancyBox still shows the error, but it's traceable to a single instance of copyFile() not having the trailing slash on the destination (and I'm guessing that AndreWolff's other skins have the same code somewhere).

The failure still appears in Missive and Sprint, and I can't figure out why. RobM's code isn't doing any copyFile()'s. The error seems to occur when the core is simply trying to copy a file from the skin's res to the output res.
davidekholm

Posts: 4,000
Registered: 18-Oct-2002
Re: Bundled projects and other skins
Posted: 19 Apr 23, 16:08   in response to: JeffTucker in response to: JeffTucker
 
A skin can easily work around this problem by issuing resDirectory.mkdirs() in init.
JeffTucker

Posts: 8,492
Registered: 31-Jan-2006
Re: Bundled projects and other skins
Posted: 19 Apr 23, 16:16   in response to: davidekholm in response to: davidekholm
 
davidekholm wrote:
A skin can easily work around this problem by issuing resDirectory.mkdirs() in init.

That's exactly what I used to do, but then you fixed the core so that res was always present before the skin tried to do anything. Seems it's gotten broken again somewhere along the line.

Forcing the creation of the output res does seem to cure the crash in Missive and Sprint.
RobM

Posts: 4,047
Registered: 4-Aug-2006
Re: Bundled projects and other skins
Posted: 19 Apr 23, 16:50   in response to: JeffTucker in response to: JeffTucker
 
Thanks to both you and David for sorting this. For future reference I have updated the scripting wiki to include checking for an album res folder. Memory is short but at least I can remember where to look.
Legend
Forum admins
Helpful Answer
Correct Answer

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