Options

Image ID overflow???

yanashyanash Registered Users Posts: 2 Beginner grinner
Hi Guys!

I get weird response when I upload an image to http://upload.smugmug.com/. It does look like you are using 32-bit integer at some point but image IDs ran out of the space.

Here is sample reply, notice that image ID in URL is fine, but the ID it self is negative:

<?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><struct> <member><name>method</name><value><string>smugmug.images.upload</string></value></member><member><name>Image</name><value><struct><member><name>id</name><value><int>-2146731493</int></value></member><member><name>Key</name><value><string>2JCtpBT</string></value></member><member><name>URL</name><value><string>http://allseasons.smugmug.com/Catego...525767_LdRQQC#2148235803_2JCtpBT</string></value></member></struct></value></member></struct></value></param></params></methodResponse>

Comments

  • Options
    rainforest1155rainforest1155 Registered Users Posts: 4,566 Major grins
    edited October 14, 2012
    Can you share more details on what uploader, browser and operating system you used? If you used the API, what version of the API did you use?

    If you didn't use the API, with what tools did you obtain the response that you posted?
    Can you reproduce the result? If so could you provide the steps that you take to get that response result?
    Sebastian
    SmugMug Support Hero
  • Options
    Chicago6061Chicago6061 Registered Users Posts: 5 Beginner grinner
    edited October 14, 2012
    I too have seen a problem. When calling 'smugmug.images.get' I get an exception: 'Value was either too large or too small for an Int32'. I'm using the http://smugmugc3.codeplex.com C# wrapper. This is only happening on albums created in the last day or so.
    Can you share more details on what uploader, browser and operating system you used? If you used the API, what version of the API did you use?

    If you didn't use the API, with what tools did you obtain the response that you posted?
    Can you reproduce the result? If so could you provide the steps that you take to get that response result?
  • Options
    rainforest1155rainforest1155 Registered Users Posts: 4,566 Major grins
    edited October 15, 2012
    I too have seen a problem. When calling 'smugmug.images.get' I get an exception: 'Value was either too large or too small for an Int32'. I'm using the http://smugmugc3.codeplex.com C# wrapper. This is only happening on albums created in the last day or so.
    That sounds like something that would need to be fixed in that C# wrapper where it's using Int32 instead of an element capable of larger numbers. Check out this post from Nik - it's also something he had to fix on his end. So I'm not seeing anything pointing towards a change on our end other than the image ID has outgrown the int32 element used in some apps.

    That said I'll check with our team to see if we can make it clearer in the API docs on what specified element should be used for the imageID.
    Sebastian
    SmugMug Support Hero
  • Options
    Chicago6061Chicago6061 Registered Users Posts: 5 Beginner grinner
    edited October 15, 2012
    I can confirm that after having patched the C# wrapper library to use 'long' instead of 'int', everything works fine again...
    That sounds like something that would need to be fixed in that C# wrapper where it's using Int32 instead of an element capable of larger numbers. Check out this post from Nik - it's also something he had to fix on his end. So I'm not seeing anything pointing towards a change on our end other than the image ID has outgrown the int32 element used in some apps.

    That said I'll check with our team to see if we can make it clearer in the API docs on what specified element should be used for the imageID.
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 16, 2012
    yanash wrote: »
    Hi Guys!

    I get weird response when I upload an image to http://upload.smugmug.com/. It does look like you are using 32-bit integer at some point but image IDs ran out of the space.

    Here is sample reply, notice that image ID in URL is fine, but the ID it self is negative:

    <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><struct> <member><name>method</name><value><string>smugmug.images.upload</string></value></member><member><name>Image</name><value><struct><member><name>id</name><value><int>-2146731493</int></value></member><member><name>Key</name><value><string>2JCtpBT</string></value></member><member><name>URL</name><value><string>http://allseasons.smugmug.com/Catego...525767_LdRQQC#2148235803_2JCtpBT</string></value></member></struct></value></member></struct></value></param></params></methodResponse>

    G'day yanash,

    Unfortunately, the XML-RPC spec only supports a 4-byte signed integer. You might be able to convert the result into an unsigned integer. But I believe that the best approach would be to drop XML-RPC and use other API type like JSON, etc.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
Sign In or Register to comment.