Flow to inspect compression jpeg
-
- Newbie
- Posts: 15
- Joined: Wed Nov 30, 2022 1:15 pm
Flow to inspect compression jpeg
Hi all, Happy New Year !!
Is there a way to made a flow to check compression level of jpeg file and sort files from the level ?
Best Regards,
I think maybe with imagemagick something like -format info but how to made it ?
Regards,
Christian
Is there a way to made a flow to check compression level of jpeg file and sort files from the level ?
Best Regards,
I think maybe with imagemagick something like -format info but how to made it ?
Regards,
Christian
Re: Flow to inspect compression jpeg
Image Magick has several programs that do or check stuff with images.
In this case you run the program idenify.exe (if on Windows) with the parameter -format '%Q' "path to jpeg"
This will return a value between 0 and 100 with 100 as highest quality.
You can easiest run this with the app Run Command and in the property command you enter this as a Single-line text with variables:
"C:/Program Files/ImageMagick-7.0.11-Q16-HDRI/identify.exe" -format '%Q' "[Job.Path]"
The path to your identify program may be different. Not that the variable for the job path must be in double quotes.
You will now get the JPEG quality value as a Private Data that you then can use to sort your images. This is in the property Standard output private data tag
https://www.enfocus.com/en/appstore/product/run-command
In this case you run the program idenify.exe (if on Windows) with the parameter -format '%Q' "path to jpeg"
This will return a value between 0 and 100 with 100 as highest quality.
You can easiest run this with the app Run Command and in the property command you enter this as a Single-line text with variables:
"C:/Program Files/ImageMagick-7.0.11-Q16-HDRI/identify.exe" -format '%Q' "[Job.Path]"
The path to your identify program may be different. Not that the variable for the job path must be in double quotes.
You will now get the JPEG quality value as a Private Data that you then can use to sort your images. This is in the property Standard output private data tag
https://www.enfocus.com/en/appstore/product/run-command
-
- Newbie
- Posts: 15
- Joined: Wed Nov 30, 2022 1:15 pm
Re: Flow to inspect compression jpeg
Thanks Jan,
I made the flow as you describe, it works but i didn't have information ? and have error
How can I output information in text file ? or sort result if compression is low level ?
Thanks again for your hlep,
regards,
Christian
I made the flow as you describe, it works but i didn't have information ? and have error
How can I output information in text file ? or sort result if compression is low level ?
Thanks again for your hlep,
regards,
Christian
- Attachments
-
- Capture d’écran 2024-01-10 à 11.24.01.png (108.25 KiB) Viewed 228675 times
-
- Newbie
- Posts: 15
- Joined: Wed Nov 30, 2022 1:15 pm
Re: Flow to inspect compression jpeg
I try the flow available in Enocus Run Command but have error too ... didn't find the output folder seems to be the issue....
Regards, ChristianRe: Flow to inspect compression jpeg
To be able to see the Private Data value you need to add one more folder to the flow and then Hold the connection between the last two folders.
All Metadata attached to a job is removed when the job arrives at the output folder (the last one)
Then you will see the value of the JPEG
You can then add several folders to the one after the Run command app. On each out put connection you can set rules based on the value.
All Metadata attached to a job is removed when the job arrives at the output folder (the last one)
Then you will see the value of the JPEG
You can then add several folders to the one after the Run command app. On each out put connection you can set rules based on the value.
-
- Newbie
- Posts: 15
- Joined: Wed Nov 30, 2022 1:15 pm
Re: Flow to inspect compression jpeg
Thanks a lot, now I have result .... but wrong...
First I test my command in cmd , and I check some errors (path to DLL, I change it and it's good)
and have the result : jpeg compression is 99 : all works fine
Now I translate the command in switch : I have to made this :
"C:\Program Files\ImageMagick7\magick.exe" -format "%Q" "%%InputFilePath%%"
The flow works but image goes to Folder Jpeg quality smaller than 50...
I made why you explain ( add a folder, hold connection to see value) : the value is 0, so effectively image is in the right folder,
but it is not the right value....maybe the retrieving tag is wrong ?
Regards, Christian
First I test my command in cmd , and I check some errors (path to DLL, I change it and it's good)
and have the result : jpeg compression is 99 : all works fine
Now I translate the command in switch : I have to made this :
"C:\Program Files\ImageMagick7\magick.exe" -format "%Q" "%%InputFilePath%%"
The flow works but image goes to Folder Jpeg quality smaller than 50...
I made why you explain ( add a folder, hold connection to see value) : the value is 0, so effectively image is in the right folder,
but it is not the right value....maybe the retrieving tag is wrong ?
Regards, Christian
-
- Newbie
- Posts: 15
- Joined: Wed Nov 30, 2022 1:15 pm
Re: Flow to inspect compression jpeg
Maybe I know why I haven't informations : I have no module licence for metadata.....
- Attachments
-
- Capture d’écran 2024-01-10 à 14.18.15.png (34.48 KiB) Viewed 228623 times
Re: Flow to inspect compression jpeg
Well in this case it is only Private Data.
The Metadata Module handles XML, JSON and other Metadata inputs.
On your outgoing connections, right click and select this for the good ones Then we have to specify the values that we accept for this connection.
Since the Private Data only appears as text we first have to get only the digits, this is the Search property and we looks for only digits ( \d ). With text can't use greater than or less than on this value. Instead we can use a RegExp to find text that is 50 or more. The first line will find anyhting from 50 to 99 and then we add one line if it is 100. For the other connection we send All others
The Metadata Module handles XML, JSON and other Metadata inputs.
On your outgoing connections, right click and select this for the good ones Then we have to specify the values that we accept for this connection.
Since the Private Data only appears as text we first have to get only the digits, this is the Search property and we looks for only digits ( \d ). With text can't use greater than or less than on this value. Instead we can use a RegExp to find text that is 50 or more. The first line will find anyhting from 50 to 99 and then we add one line if it is 100. For the other connection we send All others
-
- Newbie
- Posts: 15
- Joined: Wed Nov 30, 2022 1:15 pm
Re: Flow to inspect compression jpeg
OK i try this, can you please tell me how do you made to write in the right section of regexp conditions ?
Very best regards,
Christian
Very best regards,
Christian
Re: Flow to inspect compression jpeg
You have to click on the little > to the right and select "Inline value", after that you can write your RegExp
-
- Newbie
- Posts: 15
- Joined: Wed Nov 30, 2022 1:15 pm
Re: Flow to inspect compression jpeg
it works ! It's what I'm doing but have to write the text before select match, otherwise I can't write the regexp
Thanks for your help, I'm testing now !
Best Regards,
Christian
Thanks for your help, I'm testing now !
Best Regards,
Christian
-
- Newbie
- Posts: 15
- Joined: Wed Nov 30, 2022 1:15 pm
Re: Flow to inspect compression jpeg
Hi,
Have tested but all my images test files with different compression level goes to the same output folder.....
By the way, I made a batch script that works and give me the value in a texte file for each images, not using Switch.
Have tested but all my images test files with different compression level goes to the same output folder.....
By the way, I made a batch script that works and give me the value in a texte file for each images, not using Switch.
Re: Flow to inspect compression jpeg
Yes of course they are all over 50 in Quality.