Display original image

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

Trouble with some sites: z-index?

in
Subscribe to Trouble with some sites: z-index? 11 posts, 2 voices



IzzySoft Scriptwright
FirefoxWindows

Please take a look at this link: Here the script makes it impossible to click the "enlarge" ("vergrößern") link for the main picture, since the outline area marking the "next page" image overlaps with it and links to the next page. I worked around that by adding that site to the exclusion list (which is OK for me), but after each update I have to add this exclusion again. A fix would be fine - marking the site in the script by @exclude until you find time for a real solution would be OK (for me) as well.

TIA,
Izzy.

 
Crend King Script's Author
FirefoxWindows

Thanks for reporting this! Actually it is not caused by z-index issue. It is because of the border. There are two images (with 1x1 geometry original, enlarged) over the image, like navigation controls. They are totally adjacent. After adding the 1px red border, the right image is forced to move down, over the "enlarge" icon.

To fix this, simply set the border width to 0px. However, since there is no site-specific setting in the script, you will not see border in any websites.

In fact, this is quite a site-specific issue, not a general one, thus I may not make hard-coded patch for immowelt.de. Fortunately, Display original image now is considered stable, and will not be updated frequently. If you want, I can change the code for you for the current version. Or if you want, you can change the code yourself.

Sorry and thanks!

 
IzzySoft Scriptwright
FirefoxWindows

Thank you for your fast response! I was aware of the fact there may be no easy way to create a "general fix" (which is why I suggested to temporarily @exclude this domain - but due to the "stable state" and "not to many updates", I can do so from the GM script manager). Will not be easy to automatically detect possible causes to this kind of trouble.

But maybe I though can make some suggestions:
1) would be to move the configured variables out of the script, so they won't be overwritten on updates. Since all affected settings here are scalars, this can be achieved easily - just have a look at this guide.
2) is to add a new setting for a minimal size for an image to be considered. I see no good reason to consider 1x1px images here: First, they are far to small to be seen if not enlarged (sure, if you add a border you will notice) - and when they're enlarged, they do not contain any "information" you can tell. Second, they are usually placeholders ("spacers") only, and thus are not even intended to carry any information. I'd even go so far to count all images having less than 5px wither width or height in this category - but setting it to "2" for sure is on the safe side.

 
IzzySoft Scriptwright
FirefoxWindows

Oi. For 1), please look here. I could not resist, so I already fulfilled my own request. Guess you will like it (much more user friendly). Only changed things above the "code section". After installing it (and reloading the page), just check your GM user scripts menu for an entry to invoke the configuration screen.

Take over the code if you like it Cool

As for 2), shouldn't check_min_edge have prevented this with its default of 20px?

 
Crend King Script's Author
FirefoxWindows

Hello! Thanks for your suggestion! Actually they are all very reasonable.

For 1), I used GM_getValue/GM_setValue in my other script Textarea Backup with expiry. I never used GM_config before, but it seems like a pretty GUI config. The reason I hard coded the config is only because it is more handy for me to debug when I was writing the script. I simply thought these scripts are not popular enough to worthy put a serious config system into them, although usually things go on the opposite way, i.e. they get popular after you make it easier to use. I may make some change later.

For 2), check_min_edge is the variable you want. However, currently it only check the target geometry, not the source. For example, it cares an 1x1 (source) -> 20x20 (target) enlarged image but not 1x1 ->20x19. It also ignores 20x20 -> 19x19 shrinked images. I have made the change so that check_min_edge checks both in version 1.3.3, and the issue in immowelt.de is now corrected. Give it a try.

However, if in another website, there are two adjacent images, placed in a container, with geometry equal or larger than 20x20, the extra border added from this script will still distort their positions. This issue may not be corrected unless the script checks the adjacency of every two images, which becomes a complicated graph problem. Simply disable border or exclude the site in such cases.

 
IzzySoft Scriptwright
FirefoxX11

Crend King wrote: usually things go on the opposite way, i.e. they get popular after you make it easier to use. I may make some change later.

I fully agree - which is one of the reasons I made the changes for you. As to the debugging: Sure those changes are harder to do in the changed script - but calling the config screen and change it once (and maybe a second time to revert) shouldn't be a big deal either.

However, concerning the second issue there's a little (temporary) drawback: GM_config doesn't allow you to store a zero (0) as integer. I'm the author of the GM_config extender, and also work on the basic GM_config script together with its main authors Joe and Sizzle - so I sent a fix to Joe already who "owns" the script here at USO, so he hopefully publishes it soon.

check_min_edge is the variable you want. However, currently it only check the target geometry, not the source.

I already suspected that, but forgot to mention it. At the machine at work I already worked around it setting the borders to 0 - so now I will update the script at my home computer and see whether it works. No doubt it will (confirmed: It does!). And: Sure, there will always be "special issues on special sites" - but now it's one less. Thank you very much for your fast reaction!

 
IzzySoft Scriptwright
FirefoxWindows

Crend: On your last update, you increased the version number in the change log (1.3.3) - but not in the MetaData (still 1.3.2). Since I don't think this was done on purpose, I thought I drop you a note Tongue

 
Crend King Script's Author
FirefoxWindows

Thanks. I forgot to update...

 
IzzySoft Scriptwright
FirefoxWindows

You're welcome!
Btw: If you need any help with the UI, feel free to contact me. Remember I'm the author of the GM_config Extender - so if you miss something, I can probably help. Moreover, Joe already fixed the issue with the zero mentioned above and published an update of GM_config, so everything is ready LOL
And if you want to include my GM_ScriptUpdater, just let me now and I adapt the code on pastebin (including a hook into the GUI to adjust the update check interval plus to "check for updates now")...

 
Crend King Script's Author
FirefoxWindows

Thanks. Recently I'm a bit busy at work, but I'll let you know if I need help.

 
IzzySoft Scriptwright
FirefoxX11

Crend, I just updated the snippet at PasteBin to match the latest release. All you had to do to integrate the UI is to replace the "preference section" with the code from there (and, of course, include the two @require statements). So it's a matter of 2-5min at maximum.

To give you some idea (and make you hungry, hopefully):
ImageHost.orgImageHost.org

Of course, tootips are displayed when hovering an option...

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