Display original image

By Crend King Last update Dec 24, 2009 — Installed 3,887 times.

min_size_diff?

in
Subscribe to min_size_diff? 5 posts, 2 voices



IzzySoft Scriptwright
FirefoxX11

Is there something like min_size_diff? If the difference is less than, say, 10%, to me it makes no sense to show the borders (in most cases, they just get annoying then - I often see them for navigation elements resized from e.g. 24x24 to 22x22px. Just a suggestion Wink

 
Crend King Script's Author
FirefoxWindows

Good suggestion. These are all good features, and easy to implement. But you see, there have been so many variables to tune up... Maybe I will make a version 2.0 with GUI config, plus this feature later.

 
IzzySoft Scriptwright
FirefoxX11

Why not - this option is a "nice to have" and nothing urgent. As for the GUI config, I already sent you the code - you just need to copy'n'paste it into your code. Fully working, and even multi-lingual (the code I sent you supports English and German).

 
Crend King Script's Author
FirefoxWindows

Updated v1.3.4. How do you think about the area diff feature?

 
IzzySoft Scriptwright
FirefoxX11

It's about the idea I posted - but the setting is a bit confusing with "integer part" and "float part" - on a first look. Do I read the default value correctly: 400.1 means a difference of either 10% AND 400 (square?) pixels? Or is it 10% OR 400 (square?) pixels? And that check_min_area applies to the resulting size, while the integer part of check_min_diff is about the difference?

As an example of confusion, imagine the default values set - and a picture of 100x100 resized to 400x400: According to check_min_area it should have a border (you cound "400px" here - or "1600px^2?). According to check_min_diff, it shouldn't (diff is less than 400). Which one has priority? Oh, yes: the 10% are met - so I guess the integer and float parts are OR related. But if set to "400.0", it does not get clear which one has the higher priority. Maybe you could point this out in the documentation, like e.g. "if in conflict with the results of check_min_area, check_min_diff has priority" (or the other way round, whatever applies)?

Thinking about it: The border should only be shown if both, check_min_areaANDcheck_min_diff say "Yes, please!". Since the former specifies the absolute minimal area, and the latter the required size difference - both must be satisfied. Guess you already considered this in your code - just the description does not make it clear. In this case, above addition gets obsolete and instead it should say for both settings, that the border is only applied if both of them result in "TRUE".

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel