Image load gives a completely black image

Mobile Testing, Android App Testing.
fsiglia
Posts: 10
Joined: Mon Sep 03, 2018 10:23 am

Image load gives a completely black image

Post by fsiglia » Wed Sep 26, 2018 11:24 am

hello everyone, I have a problem with bitmap loading. When I call the method Imaging.Load(<path of the bitmap I want to load>) the loaded image is completely black. I noticed that by opening the same image with windows photo editor there is the same problem. Also, windows photo editor refuses to let me modify the image, saying that it has too low of a resolution to do so. Is this the root of the problem? Thanks in advance!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Image load gives a completely black image

Post by odklizec » Wed Sep 26, 2018 12:02 pm

Hi,

If the image opens black in windows image editor, then there is most probably a problem with the image itself? Do you know the source of the image? Can you share it?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

fsiglia
Posts: 10
Joined: Mon Sep 03, 2018 10:23 am

Re: Image load gives a completely black image

Post by fsiglia » Wed Sep 26, 2018 1:16 pm

I think there is no problem with the image itself, as I can open and view it correctly with paint 3d. maybe Imaging.Load() has a problem loading very tiny images? I attached the image below, hope it can help.
Attachments
SFE_VC_assente.png
SFE_VC_assente.png (819 Bytes) Viewed 67 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Image load gives a completely black image

Post by odklizec » Wed Sep 26, 2018 1:52 pm

Well, the image is definitely weird. Some viewers/editors simply don't like it? IrfanView shows it black too and the image information says that it contains just 1 unique color. If you save it in Paint 3D as BMP, then it will be OK. So my guess is that it's a combination of compression and transparency that causes the issue?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

fsiglia
Posts: 10
Joined: Mon Sep 03, 2018 10:23 am

Re: Image load gives a completely black image

Post by fsiglia » Wed Sep 26, 2018 2:21 pm

thanks for the hint, I will try to convert the png images to bmp files with an external tool and restart the test, I'll let you know.

fsiglia
Posts: 10
Joined: Mon Sep 03, 2018 10:23 am

Re: Image load gives a completely black image

Post by fsiglia » Wed Sep 26, 2018 2:57 pm

this did the trick! thank you for your help!