Jump to content

Smart WebP Compression


Recommended Posts

Instead of asking users to edit the keyword, make it editable: Add a new Keyword configuration and set it in the workflow as {var:whatever_name} (this is explained in the linked page).


Why isn’t the presets and logs folder also defaulting to the workflow’s data folder, like the documentation folder?


Setting an images folder in the configuration seems more cumbersome than it needs be. It’s fine to have it as an option, but a File Action Trigger should be available too. A File Filter Input could connect to the same place too. Tangentially, for it to not be optional (but it should be) you should set it as required in the configuration’s backend instead of (or in addition to) mentioning it in the documentation.


The submission is also missing a listing of the required dependencies. Plus, in the workflow you’re installing extra software on the user’s behalf, which should not happen. Alfred itself can install Homebrew and dependencies from there. Seems like you’re installing perl modules too?

Link to comment
Share on other sites

Hello @vitor,

 

Thank you for your feedback ! Regarding the first two points, you're right, I'll put a configuration for the trigger and merge the two folder, it will be less confusing. in addition, I'll remove the possibility to install extra dependency within the workflow. To be honest I didn't know that Alfred could install brew and perl packages by itself.

The list of dependencies is shown in the workflow and in the documentation:

Homebrew -> to install webp, jq and cpanm
webp -> to compress images
jq -> to manipulate json data
cpanm -> to install mojo
mojolicious -> perl dependency to scrape cwebp documentation

 

However, I don't understand your third point. For me it is easier to target a folder using file filter (in the workflow) and save it as a "config variable". I remarked that env variable  aren't working when I was using the configuration. This value is intentionally optional because the workflow can't be triggered if a value is not set up (when required) which is not what I want as it is more practical to configure it within the workflow ! Same for the preset.

 

Lastly, could you explain this :

13 hours ago, vitor said:

The submission is also missing a listing of the required dependencies

 

Many thanks in advance !

Link to comment
Share on other sites

4 hours ago, BenjaminO said:

To be honest I didn't know that Alfred could install brew and perl packages by itself.


Not the Perl packages, it is extremely rare to see a Workflow needing that.

 

Why require a web framework anyway? If it’s for the documentation, it’s definitely too much. It’s OK to include docs, but they shouldn’t require the user to install extra software. At that point, it’s best to send them to a web page.

 

4 hours ago, BenjaminO said:

For me it is easier to target a folder using file filter (in the workflow) and save it as a "config variable".


That requires two steps every time you want to compress, one to set the folder and another to compress. There should at least be the option to select and compress in one go, which the File Filter and File Action can do.

 

4 hours ago, BenjaminO said:

I remarked that env variable  aren't working when I was using the configuration.


I don’t understand this part.

 

4 hours ago, BenjaminO said:

Lastly, could you explain this


You’ve done that in your post, it’s the list of software to install.

Link to comment
Share on other sites

Ok I understand. The offline doc is only there to help new user to copy paste options into their presets. I'll remove the perl script (so no more perl dependency needed) and I'll make the offline doc exportable (txt file in the workflow folder).

 

I am adding a new way to compress images to be more intuitive and straightforward even though I like reviewing my parameters before running the cwebp script

 

2 hours ago, vitor said:

I don’t understand this part.

I remarked that when setting User Configuration (text fields, text area...), env variables were not working. I don't know why. That is the reason I put Images folder into User Configuration.

 

EDIT : Do you know what's the short way to access the path of the workflow folder. I only see this way :

{const:alfred_preferences}/workflows/{const:alfred_workflow_uid}/

which is not super practical.

Edited by BenjaminO
Link to comment
Share on other sites

Hello @vitor, I just updated the workflow with a 2.0 version! 

 

Here are the changes made:

On 12/29/2022 at 8:23 PM, vitor said:

Instead of asking users to edit the keyword, make it editable: Add a new Keyword configuration and set it in the workflow as {var:whatever_name} (this is explained in the linked page).

 

screen1.thumb.png.994b53ad4a714ef4c0de629a4fe7fa7c.png

screen2.thumb.png.27fffec7ad5b9e8a9ba8f99133996dbe.png

 

On 12/29/2022 at 8:23 PM, vitor said:

Why isn’t the presets and logs folder also defaulting to the workflow’s data folder, like the documentation folder?

Presets and logs folder are now located in the the workflow’s data folder by default and can be change in the User Configuration panel. The doc is in the workflow folder (exported).

 

On 12/29/2022 at 8:23 PM, vitor said:

Setting an images folder in the configuration seems more cumbersome than it needs be. It’s fine to have it as an option, but a File Action Trigger should be available too. A File Filter Input could connect to the same place too. Tangentially, for it to not be optional (but it should be) you should set it as required in the configuration’s backend instead of (or in addition to) mentioning it in the documentation.

No more images folder or preset to select before the compression. Now we can use Universal actions (or regular search files) to select both folders and images at the same time using the buffer to compress everything. There is also the possibility to input manual options instead of presets.

 

On 12/29/2022 at 8:23 PM, vitor said:

The submission is also missing a listing of the required dependencies. Plus, in the workflow you’re installing extra software on the user’s behalf, which should not happen. Alfred itself can install Homebrew and dependencies from there. Seems like you’re installing perl modules too?

The workflow is no more installing anything. I removed perl dependencies. Only Homebrew, webp (cwebp) and jq are needed.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...