<?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 Catch download errors from attachments.download() in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/catch-download-errors-from-attachments-download/m-p/1018557#M5458</link>
    <description>&lt;P&gt;Hi, I have stumbled upon what seems to be a spurious error when downloading attachments. One of my jpg attachments downloaded but was corrupt - bottom half of image is grey. The original is not corrupt. I then try to process this corrupt image and my script breaks. Is there a way of 'catching' the result. I know&amp;nbsp;attachments.download() &amp;nbsp;should return a file path but as the image did save to file I expect this would not return an error. I haven't been able to replicate the error as all the attachments subsequently download correctly. It does seem to have been a slow connection or file system type error. Is there a good way to check if an image file is corrupt. I fails when I try to rotate the image. I would like to re-download the suspect image immediately if I can detect the condition.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2021 02:13:02 GMT</pubDate>
    <dc:creator>IanHamilton2</dc:creator>
    <dc:date>2021-01-21T02:13:02Z</dc:date>
    <item>
      <title>Catch download errors from attachments.download()</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/catch-download-errors-from-attachments-download/m-p/1018557#M5458</link>
      <description>&lt;P&gt;Hi, I have stumbled upon what seems to be a spurious error when downloading attachments. One of my jpg attachments downloaded but was corrupt - bottom half of image is grey. The original is not corrupt. I then try to process this corrupt image and my script breaks. Is there a way of 'catching' the result. I know&amp;nbsp;attachments.download() &amp;nbsp;should return a file path but as the image did save to file I expect this would not return an error. I haven't been able to replicate the error as all the attachments subsequently download correctly. It does seem to have been a slow connection or file system type error. Is there a good way to check if an image file is corrupt. I fails when I try to rotate the image. I would like to re-download the suspect image immediately if I can detect the condition.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 02:13:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/catch-download-errors-from-attachments-download/m-p/1018557#M5458</guid>
      <dc:creator>IanHamilton2</dc:creator>
      <dc:date>2021-01-21T02:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Catch download errors from attachments.download()</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/catch-download-errors-from-attachments-download/m-p/1019535#M5471</link>
      <description>&lt;P&gt;Hi, I have a couple of suggestions,&lt;/P&gt;&lt;P&gt;1. check size of image file (may not be 100%)&lt;/P&gt;&lt;P&gt;2. use PIL (python imaging library) to&amp;nbsp; open() and verify() the image file.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 05:56:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/catch-download-errors-from-attachments-download/m-p/1019535#M5471</guid>
      <dc:creator>VictorTey</dc:creator>
      <dc:date>2021-01-25T05:56:01Z</dc:date>
    </item>
  </channel>
</rss>

