[solved] Mixed artist pictures (2 Viewers)

horned_reaper

Test Group
  • Team MediaPortal
  • January 7, 2011
    1,233
    461
    Munich
    Home Country
    Germany Germany
    After a second cleanup and some hours playback no Marilyn Manson mixture. Let's keep our fingers crossed! ;)

    Another finding: Apparently FH compares picture names case-sensitive. Many pictures are duplicative (same content), with the same interpret name e. g.:
    1584218044354.png
     
    Last edited:

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    16,069
    11,153
    Kyiv
    Home Country
    Ukraine Ukraine
    You have 10 pictures in settings for artist, it doesn’t matter in which register the file is named, the main thing is that it is tied to one artist, since the numbers are different, it’s from different sites or from one but different pictures. but if these are the same pictures, but have different numbers, then it means from different sites and I can’t do anything here.

    --
    WBR, ajs :):whistle::coffee:
     

    horned_reaper

    Test Group
  • Team MediaPortal
  • January 7, 2011
    1,233
    461
    Munich
    Home Country
    Germany Germany
    Thanks for your explanation.
    It would be useful if FH would store only pictures for an artist with different file sizes, to avoid duplicates.
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    16,069
    11,153
    Kyiv
    Home Country
    Ukraine Ukraine
    This is quite complicated, if we take pictures from 10 sites, then we have a great chance for doubles, you can analyze them for doubles, but it's difficult, I abandoned this idea. Set the number of fans to 3 rather than 10, this will reduce the option of doubles, reduce the size of the fans and increase the chance of not getting into duplicates.

    --
    WBR, ajs :):whistle::coffee:
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    16,069
    11,153
    Kyiv
    Home Country
    Ukraine Ukraine
    file size is not an indicator, you need to analyze all the downloaded fans, on a new double.

    --
    WBR, ajs :):whistle::coffee:
     

    horned_reaper

    Test Group
  • Team MediaPortal
  • January 7, 2011
    1,233
    461
    Munich
    Home Country
    Germany Germany
    The likeliness that there are different pictures with exactly the same size (in byte) for one specific artist is very, very low.

    When a new picture is found, check if there already is a picture with exactly the same file size for this (single) artist stored. This seems to be a safe check and very easy to implement.
     
    Last edited:

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    16,069
    11,153
    Kyiv
    Home Country
    Ukraine Ukraine
    File size is not an indicator; you need to analyze the contents. I have pictures of the same size but different content.

    --
    WBR, ajs :):whistle::coffee:
     

    horned_reaper

    Test Group
  • Team MediaPortal
  • January 7, 2011
    1,233
    461
    Munich
    Home Country
    Germany Germany
    What about comparing the hash value of a new picture with the has values of the other (maximum 9) stored pictures of an artist before storing it?
    Code:
    using System;
    using System.Security.Cryptography;
    using System.Text;
    
    namespace ComputeAHash_csharp
    {
    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    class Class1
    {
    static void Main(string[] args)
    {
    string sSourceData;
    byte[] tmpSource;
    byte[] tmpHash;
    sSourceData = "MySourceData";
    //Create a byte array from source data
    tmpSource = ASCIIEncoding.ASCII.GetBytes(sSourceData);
    
    //Compute hash based on source data
    tmpHash = new MD5CryptoServiceProvider().ComputeHash(tmpSource);
    Console.WriteLine(ByteArrayToString(tmpHash));
    
    sSourceData = "NotMySourceData";
    tmpSource = ASCIIEncoding.ASCII.GetBytes(sSourceData);
    
    byte[] tmpNewHash;
    
    tmpNewHash = new MD5CryptoServiceProvider().ComputeHash(tmpSource);
    
    bool bEqual = false;
    if (tmpNewHash.Length == tmpHash.Length)
    {
    int i=0;
    while ((i < tmpNewHash.Length) && (tmpNewHash[i] == tmpHash[i]))
    {
    i += 1;
    }
    if (i == tmpNewHash.Length)
    {
    bEqual = true;
    }
    }
    
            if (bEqual)
                Console.WriteLine("The two hash values are the same");
            else
                Console.WriteLine("The two hash values are not the same");
            Console.ReadLine();
    }
    
    static string ByteArrayToString(byte[] arrInput)
    {
    int i;
    StringBuilder sOutput = new StringBuilder(arrInput.Length);
    for (i=0;i < arrInput.Length -1; i++)
    {
    sOutput.Append(arrInput[i].ToString("X2"));
    }
    return sOutput.ToString();
    }
    }
    }

     

    horned_reaper

    Test Group
  • Team MediaPortal
  • January 7, 2011
    1,233
    461
    Munich
    Home Country
    Germany Germany
    Understood. You're right.

    There are code solutions to compare the content of pictures:

    In my database there are many duplicate pictures and if a duplicate is downloaded it reduces the amount of maximum 10 different pictures per artist.
     

    Users who are viewing this thread

    Top Bottom