ausi / respimagelint

Linter for Responsive Images - https://ausi.github.io/respimagelint/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to pass any options?

landwire opened this issue · comments

On "A fitting image source should be available for all screen sizes" I would like images to be allowed to differ for up to 15%.
Is that possible?

I can see the options in the script.
const threshold = 0.05;
const thresholdPx = 15;

If I cannot adjust those, could I create my own instance of the bookmarklet?
How would I do this?

Other Question:
Would it also be possible to compare the images based on image size rather than on width?
Then you could use a threshold of lets say 50kb or maybe an array of thresholds depending on the viewports?
So maybe on small screens the threshold wants to be 15kb, but on bigger screens you want to go up to 50kb.

Is it possible to pass any options?

No, currently it is not possible to configure any options of the linter.

On "A fitting image source should be available for all screen sizes" I would like images to be allowed to differ for up to 15%.
Is that possible?

The threshold for that check (missingFittingSrc) is set to 50%, see

If I cannot adjust those, could I create my own instance of the bookmarklet?
How would I do this?

This project uses gulp.js to build the source code. Running npm install and ./node_modules/.bin/gulp should build the bookmarklet inside the dist folder.

Would it also be possible to compare the images based on image size rather than on width?

I’m not sure if we have access to the file sizes of the images. But if this project one day gets rewritten as a dev-tools extension (see #10 (comment) ) this should definitely be possible.