Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add image size in related images for ones that do not have it ('JUL19' version) #201

Open
needforsuv opened this issue Nov 5, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@needforsuv
Copy link

While the extension works with the 'OCT19' version, it misses some images with the JUL19 version, but with some workarounds I can still reach the full sized image.

However, it is annoying when google doesn't even show the image size sometimes.

While it may be infeasible to grab the image url for the view image button from an element before clicking, it should be easier to add the size of the image before clicking in.

Related Image with Size (Image url in Red and Size info in Blue)
Related Image with Size

Related Image without Size
Related Image without Size

Basically, I need help with and/or would appreciate something that takes the &w=### and &h=### values from the href and injects an element after irc_rii that contains the size (w x h) (display always or on hover) for each related result tile.

This may or may not also help fixing the general issues with the button and the 'JUL19' version when it comes to fixing getting the full image url without relying on an raw source array or whatever clunky fix (like in issue #188).
'Oct19'version for reference
'Oct19'version

@needforsuv
Copy link
Author

haven't figured out how to get the full size image by view image like with Google Image Search Restored with related images and such, but in the meantime I can at least see how big a related image is with this script before bypassing the google image layer all together

// ==UserScript==
// @name        Related images Size
// @namespace   http://localhost
// @description Adds image size to broken related images
// @version     1.0
// @include     http*://*.google.tld/search*tbm=isch*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
// @require  https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant    GM_addStyle
// ==/UserScript==


waitForKeyElements (".irc_rimc", actionFunction);

function actionFunction () {

    $(".rg_l:has(.irc-rito)").each(function() {
    var url = this.href;
    $(this).attr('href', url);
var width = url.substring(url.indexOf("&w=") + 3, url.indexOf("&h="));
var height = url.substring(url.indexOf("&h=") + 3, url.indexOf("&", url.indexOf("&h=") + 3));     
var size = width + " × " + height;
//$(`<div class="rg_ilmbg.added">${size}</div>`).appendTo(this);  
$(this).append(`<div class="rg_ilmbg">${size}</div>`);   
//$(`<div class="rg_ilmbg.added">${size}</div>`).appendTo(this);
        
});
    
    

}


I've kinda made peace with it now...

@bijij bijij added the enhancement New feature or request label Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants