miyako / 4d-plugin-ql-v2

Use QuickLook API to generate thumbnails and previews.
MIT License
1 stars 0 forks source link

No options object returned from Create Picture #2

Open nilskoll opened 1 year ago

nilskoll commented 1 year ago

Hi Keisuke! As I explained on the last day of summit, i'm having some issues with the v2 of QL plugin.

On 4D v20.1 build 20.100677, macOS Sonoma 14.0 calling QL Create Preview returns a blob, but the object is empty. Without the options, I'm unable to parse the blob and get the picture out.

The source file is a pdf (all pdf's as far as I can see. A Sample.pdf is enclosed. Sample.pdf

QL Create thumbnail works mostly (docs should probably be changed to leave out the options which is no longer there). I have one pdf that creates a blank thumbnail, quciklook in Finder works as expected. Enclosed he 972.pdf re

miyako commented 1 year ago

I traced the code.

I confirm that $2 is empty, which I can fix in 2.2.0 but as for the $data, it is the original PDF returned "as is".

it seems QuickLook does not do anything for PDF, since PDF is the default preview format.

nilskoll commented 1 year ago

I see. Thanks for looking at this so quickly. I'll use "sips" to convert the pdf to a jpg then

miyako commented 1 year ago

you can also use 4D command to scale and export.

TRANSFORM PICTURE($picture; Scale; 4; 4)
WRITE PICTURE FILE($rootPath+"preview.jpg"; $picture; "public.jpeg")
nilskoll commented 1 year ago

Yes, I've tried that, but scaling up a raster image doesn't give the same quality as creating a larger size image from the original pdf.