Posts:
8,591
Registered:
31-Jan-2006
|
|
|
|
Crop focus on PDF thumbs
Posted:
1 Apr 26, 03:50
|
|
|
|
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.
|
|
|
Posts:
4,028
Registered:
18-Oct-2002
|
|
|
|
Re: Crop focus on PDF thumbs
Posted:
1 Apr 26, 14:31
in response to: JeffTucker
|
|
|
|
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.
|
|
|
Posts:
8,591
Registered:
31-Jan-2006
|
|
|
|
Re: Crop focus on PDF thumbs
Posted:
1 Apr 26, 14:59
in response to: davidekholm
|
|
|
|
|
|
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.
|
|
|
Posts:
4,028
Registered:
18-Oct-2002
|
|
|
|
Re: Crop focus on PDF thumbs
Posted:
1 Apr 26, 15:48
in response to: JeffTucker
|
|
|
|
I don't get it. When the image is created, it's not cropped at all, just resized to a reasonable "full screen" size.
|
|
|
Posts:
8,591
Registered:
31-Jan-2006
|
|
|
|
Re: Crop focus on PDF thumbs
Posted:
1 Apr 26, 16:15
in response to: davidekholm
|
|
|
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
|
|
|
Posts:
8,591
Registered:
31-Jan-2006
|
|
|
|
Re: Crop focus on PDF thumbs
Posted:
1 Apr 26, 16:16
in response to: JeffTucker
|
|
|
|
|
|
This is what you'll see, attached.
|
|
|
Posts:
4,028
Registered:
18-Oct-2002
|
|
|
|
Re: Crop focus on PDF thumbs
Posted:
1 Apr 26, 17:14
in response to: JeffTucker
|
|
|
|
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?
|
|
|
Posts:
4,028
Registered:
18-Oct-2002
|
|
|
|
Re: Crop focus on PDF thumbs
Posted:
1 Apr 26, 17:17
in response to: davidekholm
|
|
|
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();
|
|
|
Posts:
8,591
Registered:
31-Jan-2006
|
|
|
|
Re: Crop focus on PDF thumbs
Posted:
1 Apr 26, 17:23
in response to: davidekholm
|
|
|
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.
|
|
|
Posts:
8,591
Registered:
31-Jan-2006
|
|
|
|
Re: Crop focus on PDF thumbs
Posted:
1 Apr 26, 17:30
in response to: davidekholm
|
|
|
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.
|
|
|
Posts:
8,591
Registered:
31-Jan-2006
|
|
|
|
Re: Crop focus on PDF thumbs
Posted:
1 Apr 26, 17:33
in response to: davidekholm
|
|
|
... 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.
|
|
|
Posts:
4,028
Registered:
18-Oct-2002
|
|
|
|
Re: Crop focus on PDF thumbs
Posted:
1 Apr 26, 17:55
in response to: davidekholm
|
|
|
|
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)
|
|
|
Posts:
8,591
Registered:
31-Jan-2006
|
|
|
|
Re: Crop focus on PDF thumbs
Posted:
1 Apr 26, 18:14
in response to: davidekholm
|
|
|
|
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.
|
|
|
Posts:
8,591
Registered:
31-Jan-2006
|
|
|
|
Re: Crop focus on PDF thumbs
Posted:
1 Apr 26, 18:36
in response to: davidekholm
|
|
|
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
|
|