title: Function Resize image: (-215:Assertion failed) !ssize.empty() in function 'resize'
body: <p>I would like to resize all images in the first folder &quot;path&quot; but I get an error.</p>
  <p>Here is my code:</p>
  <pre><code>import cv2
  import os
  
  path = &quot;./home/my_directory&quot;
  
  for image_name in sorted(os.listdir(path)):
      image_path = path+&quot;/&quot;+image_name
      print(image_name)
      img = cv2.imread(image_path)
      resize_img = cv2.resize(img, (224,224), interpolation = cv2.INTER_AREA)
  </code></pre>
  <p>I get this error:</p>
  <pre class="lang-none prettyprint-override"><code>.DS_Store
  Traceback (most recent call last):
    File &quot;resize_images.py&quot;, line 12, in &lt;module&gt;
      resize_img = cv2.resize(img, (224,224), interpolation = cv2.INTER_AREA)
  cv2.error: OpenCV(4.2.0) /io/opencv/modules/imgproc/src/resize.cpp:4045: error: (-215:Assertion failed) !ssize.empty() in function 'resize'
  </code></pre>
  <p>I use Python 3.6 and opencv-python 4.2.0.32</p>