<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic 'Could not identify file' updating item thumbnail from URL in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/could-not-identify-file-updating-item-thumbnail/m-p/1591916#M11197</link>
    <description>&lt;P&gt;I have a script that updates ArcGIS Online item thumbnails from images stored on our web server.&amp;nbsp; We moved the images to a different web server and now the updates are failing with 'Could not identify file'.&amp;nbsp; There is no problem accessing the image via URL. When I compare browser network traces accessing it on the old server and the new server I don't see anything obviously different.&amp;nbsp; I expanded the image to 600x400 since that is the recommended minimum size with no luck. I've attached a script that can be run to recreate the problem.&amp;nbsp; I'm planning on opening a ticket with ESRI, but thought I'd post it here first in case anybody has any ideas.&amp;nbsp; I'm running on Python 3.11.10 from ArcGIS Pro 3.4.0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# To recreate problem
# 1. Update the ITEM_ID variable below to an ArcGIS online item that you own
# 2. Copy this entire script file and paste it into the ArcGIS Pro (make sure you are signed in)python analysis window, hit enter twice
# 3. Enter run_test()

ITEM_ID = '758054a99d934a9d9113d8a5faccf456'

from arcgis.gis import GIS
import requests

def test_upload_as_thumbnail (item, url):
    try:
        item.update(thumbnail = url)
        print (f"Upload {url} to {item.id} as thumbnail succeeded")
    except Exception as ex:
        print (f"Upload {url} to {item.id} as thumbnail failed: {str(ex)}")
    return

def test_download (url):
    try:
        requests.get(url).content
        print (f"Download {url} succeeded")
    except Exception as ex:
        print (f"Download {url} failed: {str(ex)}")
    return

def run_test():
    gis = GIS('pro')
    for url in ['http://maps.fieldmuseum.org/apps/ROWHWG/icons/FeatureLayer.png',             # this one works
                'https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer_600_400.png', # this one fails
                'https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer.png']:        # this one fails
        test_download (url)
        test_upload_as_thumbnail(gis.content.get(ITEM_ID), url)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the output I get from the test script:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;Download &lt;A href="http://maps.fieldmuseum.org/apps/ROWHWG/icons/FeatureLayer.png" target="_blank"&gt;http://maps.fieldmuseum.org/apps/ROWHWG/icons/FeatureLayer.png&lt;/A&gt; succeeded&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Upload &lt;A href="http://maps.fieldmuseum.org/apps/ROWHWG/icons/FeatureLayer.png" target="_blank"&gt;http://maps.fieldmuseum.org/apps/ROWHWG/icons/FeatureLayer.png&lt;/A&gt; to 758054a99d934a9d9113d8a5faccf456 as thumbnail succeeded&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Download &lt;A href="https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer_600_400.png" target="_blank"&gt;https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer_600_400.png&lt;/A&gt; succeeded&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Upload &lt;A href="https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer_600_400.png" target="_blank"&gt;https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer_600_400.png&lt;/A&gt; to 758054a99d934a9d9113d8a5faccf456 as thumbnail failed: Could not identify file&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Download &lt;A href="https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer.png" target="_blank"&gt;https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer.png&lt;/A&gt; succeeded&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Upload &lt;A href="https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer.png" target="_blank"&gt;https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer.png&lt;/A&gt; to 758054a99d934a9d9113d8a5faccf456 as thumbnail failed: Could not identify file&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Mar 2025 19:33:39 GMT</pubDate>
    <dc:creator>DonMorrison1</dc:creator>
    <dc:date>2025-03-04T19:33:39Z</dc:date>
    <item>
      <title>'Could not identify file' updating item thumbnail from URL</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/could-not-identify-file-updating-item-thumbnail/m-p/1591916#M11197</link>
      <description>&lt;P&gt;I have a script that updates ArcGIS Online item thumbnails from images stored on our web server.&amp;nbsp; We moved the images to a different web server and now the updates are failing with 'Could not identify file'.&amp;nbsp; There is no problem accessing the image via URL. When I compare browser network traces accessing it on the old server and the new server I don't see anything obviously different.&amp;nbsp; I expanded the image to 600x400 since that is the recommended minimum size with no luck. I've attached a script that can be run to recreate the problem.&amp;nbsp; I'm planning on opening a ticket with ESRI, but thought I'd post it here first in case anybody has any ideas.&amp;nbsp; I'm running on Python 3.11.10 from ArcGIS Pro 3.4.0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# To recreate problem
# 1. Update the ITEM_ID variable below to an ArcGIS online item that you own
# 2. Copy this entire script file and paste it into the ArcGIS Pro (make sure you are signed in)python analysis window, hit enter twice
# 3. Enter run_test()

ITEM_ID = '758054a99d934a9d9113d8a5faccf456'

from arcgis.gis import GIS
import requests

def test_upload_as_thumbnail (item, url):
    try:
        item.update(thumbnail = url)
        print (f"Upload {url} to {item.id} as thumbnail succeeded")
    except Exception as ex:
        print (f"Upload {url} to {item.id} as thumbnail failed: {str(ex)}")
    return

def test_download (url):
    try:
        requests.get(url).content
        print (f"Download {url} succeeded")
    except Exception as ex:
        print (f"Download {url} failed: {str(ex)}")
    return

def run_test():
    gis = GIS('pro')
    for url in ['http://maps.fieldmuseum.org/apps/ROWHWG/icons/FeatureLayer.png',             # this one works
                'https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer_600_400.png', # this one fails
                'https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer.png']:        # this one fails
        test_download (url)
        test_upload_as_thumbnail(gis.content.get(ITEM_ID), url)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the output I get from the test script:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;Download &lt;A href="http://maps.fieldmuseum.org/apps/ROWHWG/icons/FeatureLayer.png" target="_blank"&gt;http://maps.fieldmuseum.org/apps/ROWHWG/icons/FeatureLayer.png&lt;/A&gt; succeeded&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Upload &lt;A href="http://maps.fieldmuseum.org/apps/ROWHWG/icons/FeatureLayer.png" target="_blank"&gt;http://maps.fieldmuseum.org/apps/ROWHWG/icons/FeatureLayer.png&lt;/A&gt; to 758054a99d934a9d9113d8a5faccf456 as thumbnail succeeded&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Download &lt;A href="https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer_600_400.png" target="_blank"&gt;https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer_600_400.png&lt;/A&gt; succeeded&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Upload &lt;A href="https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer_600_400.png" target="_blank"&gt;https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer_600_400.png&lt;/A&gt; to 758054a99d934a9d9113d8a5faccf456 as thumbnail failed: Could not identify file&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Download &lt;A href="https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer.png" target="_blank"&gt;https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer.png&lt;/A&gt; succeeded&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Upload &lt;A href="https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer.png" target="_blank"&gt;https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer.png&lt;/A&gt; to 758054a99d934a9d9113d8a5faccf456 as thumbnail failed: Could not identify file&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 19:33:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/could-not-identify-file-updating-item-thumbnail/m-p/1591916#M11197</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2025-03-04T19:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: 'Could not identify file' updating item thumbnail from URL</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/could-not-identify-file-updating-item-thumbnail/m-p/1591970#M11198</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/192850"&gt;@DonMorrison1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seems quite odd alright. Just out of curiosity, does it fail with the Item object update_thumbnail() method too. Docs &lt;A href="https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.update_thumbnail" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Edit: I tested and it failed with item.update() but was successful with item.update_thumbnail()&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clubdebambos_0-1741120401095.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126987iD26359C5B1904C68/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Clubdebambos_0-1741120401095.png" alt="Clubdebambos_0-1741120401095.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Download&amp;nbsp;&lt;A href="http://maps.fieldmuseum.org/apps/ROWHWG/icons/FeatureLayer.png" target="_blank" rel="noopener"&gt;http://maps.fieldmuseum.org/apps/ROWHWG/icons/FeatureLayer.png&lt;/A&gt;&amp;nbsp;succeeded&lt;BR /&gt;Upload&amp;nbsp;&lt;A href="http://maps.fieldmuseum.org/apps/ROWHWG/icons/FeatureLayer.png" target="_blank" rel="noopener"&gt;http://maps.fieldmuseum.org/apps/ROWHWG/icons/FeatureLayer.png&lt;/A&gt;&amp;nbsp;to&amp;nbsp;50261cda83954b8595d3c3427c0c5cb8&amp;nbsp;as&amp;nbsp;thumbnail&amp;nbsp;succeeded&lt;BR /&gt;Download&amp;nbsp;&lt;A href="https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer_600_400.png" target="_blank" rel="noopener"&gt;https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer_600_400.png&lt;/A&gt;&amp;nbsp;succeeded&lt;BR /&gt;Upload&amp;nbsp;&lt;A href="https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer_600_400.png" target="_blank" rel="noopener"&gt;https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer_600_400.png&lt;/A&gt;&amp;nbsp;to&amp;nbsp;50261cda83954b8595d3c3427c0c5cb8&amp;nbsp;as&amp;nbsp;thumbnail&amp;nbsp;succeeded&lt;BR /&gt;Download&amp;nbsp;&lt;A href="https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer.png" target="_blank" rel="noopener"&gt;https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer.png&lt;/A&gt;&amp;nbsp;succeeded&lt;BR /&gt;Upload&amp;nbsp;&lt;A href="https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer.png" target="_blank" rel="noopener"&gt;https://rightofway.erc.uic.edu/wp-content/uploads/FeatureLayer.png&lt;/A&gt;&amp;nbsp;to&amp;nbsp;50261cda83954b8595d3c3427c0c5cb8&amp;nbsp;as&amp;nbsp;thumbnail&amp;nbsp;succeeded&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Mar 2025 20:33:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/could-not-identify-file-updating-item-thumbnail/m-p/1591970#M11198</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2025-03-04T20:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: 'Could not identify file' updating item thumbnail from URL</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/could-not-identify-file-updating-item-thumbnail/m-p/1591978#M11199</link>
      <description>&lt;P&gt;Yes! I just tried it myself and it does indeed work.&amp;nbsp; Thanks so much.&amp;nbsp; I'm still curious why it works with one web server but not the other but I'll probably just change my code and move on.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 20:42:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/could-not-identify-file-updating-item-thumbnail/m-p/1591978#M11199</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2025-03-04T20:42:04Z</dc:date>
    </item>
  </channel>
</rss>

