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


Permlink Replies: 19 - Pages: 2 [ 1 2 | Next ] - Last Post: 1 Apr 26, 22:40 Last Post By: davidekholm Threads: [ Previous | Next ]
JeffTucker

Posts: 8,591
Registered: 31-Jan-2006
Crop focus on PDF thumbs
Posted: 1 Apr 26, 03:50
 
  Click to reply to this thread Reply
With the release of jAlbum 39.4 (or will it be jAlbum 40?), the core extracts a thumbnail for PDF objects. When it does so, the crop focus for those thumbnails should be automatically set to the top, rather than partway down the image.
davidekholm

Posts: 4,028
Registered: 18-Oct-2002
Re: Crop focus on PDF thumbs
Posted: 1 Apr 26, 14:31   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Do you mean during album generation? The CropFilter has a setYWeight() method that takes a float between 0 and 1. Setting it to 0 will keep the top of the image.
JeffTucker

Posts: 8,591
Registered: 31-Jan-2006
Re: Crop focus on PDF thumbs
Posted: 1 Apr 26, 14:59   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Attachment Lorem.pdf.info (455 bytes)
Attachment Lorem.pdf (165.0 KB)
No, I mean when the image is created. With a PDF that gets cropped to a fixed shape, you almost always want setYWeight() to be 0. A user might, however, want to override that, so you wouldn't want to force it during album build.

So, when the PDF is added to the project, and the thumbnail is extracted, automatically create .jalbum/Lorem.pdf.info with that focus.
davidekholm

Posts: 4,028
Registered: 18-Oct-2002
Re: Crop focus on PDF thumbs
Posted: 1 Apr 26, 15:48   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I don't get it. When the image is created, it's not cropped at all, just resized to a reasonable "full screen" size.
JeffTucker

Posts: 8,591
Registered: 31-Jan-2006
Re: Crop focus on PDF thumbs
Posted: 1 Apr 26, 16:15   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
I know that. But a lot of skins then crop the thumbnail to a fixed shape, which gets the top of the PDF cut off.

Install the latest Saturn beta:

(link to beta removed)

Then try that Lorem.pdf file with the default settings in Saturn, and take a look at the thumbnail.

ETA: This is why we don't let you do skin development.

Edited by: JeffTucker on 1 Apr 2026, 15:07
JeffTucker

Posts: 8,591
Registered: 31-Jan-2006
Re: Crop focus on PDF thumbs
Posted: 1 Apr 26, 16:16   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Attachment ss013558.png (460.1 KB)
This is what you'll see, attached.
davidekholm

Posts: 4,028
Registered: 18-Oct-2002
Re: Crop focus on PDF thumbs
Posted: 1 Apr 26, 17:14   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I get it, so this IS during album generation, and not when jAlbum generates the larger cached image. You're using the CropFilter, right? I guess I can show you how to modify it, or wrap it in a filter that adjusts the crop focus to 0 for pdf files. Shouldn't that do the trick?
davidekholm

Posts: 4,028
Registered: 18-Oct-2002
Re: Crop focus on PDF thumbs
Posted: 1 Apr 26, 17:17   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Another note: Here's how you can generate a file name with the right extension, depending on output format:
return THEME_FILE_NAME + "." + engine.getOutputFormat().getExtension();
JeffTucker

Posts: 8,591
Registered: 31-Jan-2006
Re: Crop focus on PDF thumbs
Posted: 1 Apr 26, 17:23   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
You're still not getting this. Maybe just let it sink in for a while. Or let Sparky handle it. ;)

This has nothing to do with album generation. It has to do with setting the crop focus on a newly-created PDF page image when it's added to the project. The skin isn't involved. The user doesn't have to do anything.

ETA: No matter what skin the user selects, if it's doing fixed-shape thumbnails, the crop focus for the PDF thumbnail will be where it almost always should be - at the top.
davidekholm

Posts: 4,028
Registered: 18-Oct-2002
Re: Crop focus on PDF thumbs
Posted: 1 Apr 26, 17:26   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
... right... now I'm getting it :-)
JeffTucker

Posts: 8,591
Registered: 31-Jan-2006
Re: Crop focus on PDF thumbs
Posted: 1 Apr 26, 17:30   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Another note: Here's how you can generate a file name with the right extension, depending on output format....

Handy. What will I now do with the extra 3 milliseconds of album build time?

RobM - you might want to use this.
JeffTucker

Posts: 8,591
Registered: 31-Jan-2006
Re: Crop focus on PDF thumbs
Posted: 1 Apr 26, 17:33   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
... right... now I'm getting it :-)

Is Sparky using your forum account? Can he pass the Turing Test?

I'm thinking we should create an account for him. Put Anders on it.
davidekholm

Posts: 4,028
Registered: 18-Oct-2002
Re: Crop focus on PDF thumbs
Posted: 1 Apr 26, 17:55   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Beta updated. Now the crop focus is at the top for PDFs (variable added when generating image so you need to re-add pdf's or empty the ".jalbum/cache" folder)
JeffTucker

Posts: 8,591
Registered: 31-Jan-2006
Re: Crop focus on PDF thumbs
Posted: 1 Apr 26, 18:14   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Now you've got it!

I think that I just realized what's happened. Dor has evolved beyond "hand puppet." I, for one, welcome our new Amphibian Overlord.
JeffTucker

Posts: 8,591
Registered: 31-Jan-2006
Re: Crop focus on PDF thumbs
Posted: 1 Apr 26, 18:36   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Another note: Here's how you can generate a file name with the right extension, depending on output format....

Off-topic, but lately I've been coding as if the only two possibilities are JPG and AVIF. My skins won't actually fail if someone chooses WebP, but some of the cleanup routines won't behave.

Any plans for scrubbing WebP from the core entirely? I think that's a Band-Aid that needs to be pulled off quickly, all at once. Get it over with. ;)
Legend
Forum admins
Helpful Answer
Correct Answer

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