Author Topic: [MOD] Check for duplicate images v1.0  (Read 59865 times)

0 Members and 1 Guest are viewing this topic.

Offline Crazymodder

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: [MOD] Check for duplicate images v1.0
« Reply #30 on: August 30, 2010, 09:46:31 PM »
Hi very nice mod
Is it possible to make a plugin where you can detect double images. So that you run that plugin and generate the md5 hash of all the pictures and than a plugin which search inside the database for double entries in the md5 cell?
Than list double founded images and you can delete it...

Thanks
Crazymodder

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Check for duplicate images v1.0
« Reply #31 on: August 31, 2010, 02:32:35 AM »
sure

After installation in ACP (Admin Control Panel) in "Plugins" part of menu you should see new link "Image MD5 hash update".
When you click on it for the first time, the database installation process will start.
After new fields in the databse were added, you can again click on the "Image MD5 hash update" link and generate MD5 hash for all images in your gallery.
;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Crazymodder

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: [MOD] Check for duplicate images v1.0
« Reply #32 on: August 31, 2010, 05:26:30 PM »
Yes than all my images have an md5 hash. But I don't know if there are some pictures with the same md5 hash.
So I want to show alle pcitures with the same md5 hash so that i can delete the duplicates.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Check for duplicate images v1.0
« Reply #33 on: September 01, 2010, 05:46:15 AM »
Now I see what you are saying.

currently there is no easy way to do so.

What you can do is run this query in phpmyadmin:
Code: (MySQL) [Select]
SELECT image_md5, COUNT(*) AS num
FROM 4images_images
GROUP BY image_md5
HAVING num>1
(assuming 4images_ is the table prefix set in your config.php)
It should give you a list of duplicate MD5 (if any)
Then having them, you can search for images using [MOD] Batch Copy/Move/Edit Images v4.15.1 (2010-08-14) (make sure at MD5 search field select "default" in dropdown)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: [MOD] Check for duplicate images v1.0
« Reply #34 on: October 12, 2010, 03:32:47 AM »
Now I see what you are saying.

currently there is no easy way to do so.

What you can do is run this query in phpmyadmin:
Code: (MySQL) [Select]
SELECT image_md5, COUNT(*) AS num
FROM 4images_images
GROUP BY image_md5
HAVING num>1
(assuming 4images_ is the table prefix set in your config.php)
It should give you a list of duplicate MD5 (if any)
Then having them, you can search for images using [MOD] Batch Copy/Move/Edit Images v4.15.1 (2010-08-14) (make sure at MD5 search field select "default" in dropdown)

Hi,

i have 628 duplicate files in my galery, is there a method to search for that hashes with your mod at once?
Seems to be much work: pasting each hash into the search page and deleting them after that :)

Hope there is a clou?

Maybe something directly in database? but i don't know what rows have to be infected?
And how to submit the list of 628 hashes to the command that should delete that... uh i don't know


Greetz X23

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Offline Guldstrand

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: [MOD] Check for duplicate images v1.0
« Reply #35 on: June 16, 2011, 12:45:44 AM »
Will this mod work on 1.7.10:?

Offline Eagle Eye

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Re: [MOD] Check for duplicate images v1.0
« Reply #36 on: March 27, 2013, 09:27:56 AM »
@Vano, Is it possible to modify this MOD to just simply check for duplicate filename only? Best variant would be to check for duplicate file name and extension while uploading

Thanks!

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.297
    • View Profile
    • Discover the New World of Kindersurprise
Re: [MOD] Check for duplicate images v1.0
« Reply #37 on: March 27, 2013, 05:15:58 PM »
 :thumbup: das wäre klasse, schon beim hoch laden müsste eine Meldung kommen "Dateinamen vorhanden" und Unterscheidung groß und Kleinschrift.
Danke Harald




Rembrandt

  • Guest
Re: [MOD] Check for duplicate images v1.0
« Reply #38 on: March 27, 2013, 05:44:40 PM »
Hi!
Ich verstehe nicht wozu ihr das braucht, wenn der "Dateiname" in dem selben Kategorie Ordner schon vorhanden ist, hängt 4images sowieso eine Zahl hinter den Namen drann.
Vorrausgesetzt ihr habt im ACP unter Allgemein/Einstellungen/Upload Einstellungen/Upload-Modus auf "Dateien mit neuem Namen speichern" gestellt.

mfg Andi

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.297
    • View Profile
    • Discover the New World of Kindersurprise
Re: [MOD] Check for duplicate images v1.0
« Reply #39 on: March 27, 2013, 10:42:24 PM »
nicht immer Andy, Bild ist nicht gleich bild
OK, im Web wird das unterschieden, also nicht überschrieben, wenn ich aber die Bilder als Backup auf dem Compi lade, geht mir ein Bild verloren.
Dem Compi ist es egal ob ich Bild, bild BiLd oder bILd schreibe, es ist ein Name.
Und mir sind bei einem Serverwechsel schon einige verloren gegangen.
Mach einem User mal begreiflich das er die Bilder umbenennen soll  :cry:

Ich wäre generell dafür, das Bilder beim hoch laden als MD5 umgewandelt wird (habe ich im Portal)
z.B. so d99729bcd27fd077d056e9b39.jpg

LG Harald
Danke Harald




Rembrandt

  • Guest
Re: [MOD] Check for duplicate images v1.0
« Reply #40 on: March 28, 2013, 05:10:56 AM »
Ok schon klar was du meinst, aber seit der V1.7.10 werden erstens die Dateinamen in Kleinbuchstaben umgewandelt und wenn sie gleichlautend sind, wie schon geschrieben ein Zahl hinten drann gehängt.
Somit gibt es keine Probleme mit einen Betriebssystem oder nach einen Serverwechsel.

mfg Andi

Offline Eagle Eye

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Re: [MOD] Check for duplicate images v1.0
« Reply #41 on: March 28, 2013, 10:37:29 AM »
@Vano, Is it possible to modify this MOD to just simply check for duplicate filename only? Best variant would be to check for duplicate file name and extension while uploading

Thanks!

This will be helpfull in sitivation where the file name does not change and a user uploads a same file with the same file name, instead of it being renamed and added, can this mod detect and warn that already a file with this name exists somewhere in database and need to proceed with the renaming or not!

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.297
    • View Profile
    • Discover the New World of Kindersurprise
Re: [MOD] Check for duplicate images v1.0
« Reply #42 on: March 28, 2013, 11:03:44 AM »
Ok schon klar was du meinst, aber seit der V1.7.10 werden erstens die Dateinamen in Kleinbuchstaben umgewandelt und wenn sie gleichlautend sind, wie schon geschrieben ein Zahl hinten drann gehängt.
Somit gibt es keine Probleme mit einen Betriebssystem oder nach einen Serverwechsel.

mfg Andi

 :oops: stand das wo, war mir nicht bewusst, also mein Posting vergessen  :wink:

wünsche dir frohe Ostertage (allen anderen auch)

LG Harald
Danke Harald




Rembrandt

  • Guest
Re: [MOD] Check for duplicate images v1.0
« Reply #43 on: March 28, 2013, 11:18:23 AM »
... stand das wo,....
glaube nicht, das wurde in der 1.7.10 gemacht als die Probleme mit den Umlauten bestand.

Wünsche dir auch noch Frohe Ostern
Andi