Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> [Script] gallery hash compare

 
post Mar 7 2022, 14:49
Post #1
atasitian



Casual Poster
****
Group: Members
Posts: 422
Joined: 18-July 10
Level 322 (Godslayer)


This is conceptually very similar to Dnkz's script, but with a few differences (e.g. no external dependencies like jquery.com).

This userscript compares the image hashes of two galleries, which can be helpful when deciding if and which gallery to expunge.

Usage:
  1. make sure you're browsing image galleries in "large thumbnail" mode, otherwise the script won't work at all
  2. visit the first gallery
  3. click on the new "Compare Hashes" button that is haphazardly placed in the top right corner of the page
  4. an inline popup opens, showing the current URL in the "This gallery" field (top left)
  5. paste the URL of the second gallery in the field labeled "Other gallery" (top right)
  6. click on the "Collect hashes (A)" button (bottom left) and (if the gallery is large) wait for it to finish
  7. click on the "Collect hashes (B​)" button (bottom right) and (if the gallery is large) wait for it to finish
  8. click on the "Compare" button (bottom middle)
  9. read off results
It looks like this: Attached Image

The two lists of gallery contents are highlighted to visualize the results. Images that appear in both galleries are marked green. Images that appear multiple times within the same gallery get a yellow "dupe" marker.

A short summary appears under the "Compare" button. It will tell you if the galleries contain the same images (and if so, whether they are in the same order, or otherwise the first out-of-order page), or if one gallery is a subset of the other, or otherwise how many images the galleries have in common.

Caveats:
  • The script only looks at the hashes of raw image files, so even visually identical images will be treated as different if they are not the exact same file. (Any other changes--different image format, size, resolution, etc.--will also lead to a different hash, of course.) This limits the usefulness of the script somewhat, but it is still nice for recognizing exact copies.
  • Collecting image hashes involves visiting all thumbnail pages of a gallery in the background. The script has no built-in rate limit, but it works sequentially (i.e. it will completely process one thumbnail page before fetching the next), so it won't send a hundred HTTP requests in parallel. For large galleries (with hundreds or thousands of pages) this can take a few seconds. If you have the option to show more thumbnails per page (Hath perk "more thumbs"), that would make the script more efficient.

Latest version:
2022-10-18 Attached File  gallery_hash_compare_e_hentai.org.1.2.0.user.js.txt ( 17.24k ) Number of downloads: 1157

Changes:
  • Fix: The "Compare Hashes" button is now placed on top of other page elements, so it will be visible even when it overlaps other elements.
  • The "Other gallery" input field is now automatically focused when the popup opens.
  • The script can now be activated automatically from links. If the opened URL ends with a page anchor (hash) of the form "#:hashcmp:/g/GALLERYID/GALLERYTOKEN/" (where GALLERYID is the numeric ID of the other gallery and GALLERYTOKEN is the alphanumeric gallery token), for example https://e-hentai.org/g/2155332/aaae7b098a/#...459/f267c91b21/, then the current gallery is automatically compared to the other gallery specified in the hash parameter. This doesn't really do anything by itself, but it can be used by other scripts to create auto-compare links.


Previous versions:
2022-06-13 Attached File  gallery_hash_compare_e_hentai.org.1.1.3.user.js.txt ( 21.6k ) Number of downloads: 23

Changes:
  • comparison results are described slightly differently (e.g. instead of "B is a subset of A" it now says "A is a superset of B", always listing the left gallery first)
  • the script will always tell you whether common images have the same relative order in both galleries (previously it would only do so if the galleries were permutations of each other)
  • images marked as duplicate now also link back to the original
  • the pop-up can be closed with the Esc key
2022-03-07 Attached File  gallery_hash_compare_e_hentai.org.user.js.txt ( 17.36k ) Number of downloads: 32


This post has been edited by atasitian: Oct 18 2022, 12:48
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Mar 11 2022, 00:38
Post #2
Mayriad



SUPER ★ BUSY ★ TIME
*******
Group: Global Mods
Posts: 2,061
Joined: 18-December 10
Level 127 (Lord)


I am a bit too busy to have a better look, but I have added it to the userscript index now. Thanks for this new script.
User is online!Profile CardPM
Go to the top of the page
+Quote Post

 
post Oct 18 2022, 12:51
Post #3
atasitian



Casual Poster
****
Group: Members
Posts: 422
Joined: 18-July 10
Level 322 (Godslayer)


Script updated to version 1.2.0.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 29th April 2024 - 21:49