Robohash
Robohash copied to clipboard
One particular IP address crashes, but only on set5
This is weird:
import robohash rh = robohash.Robohash("65.255.59.74") rh.assemble(roboset='set5')
Traceback (most recent call last):
File "
Change the IP address by one digit, change the set, and it works fine.
pip freeze | grep -i robo robohash==1.0
Am I doing something wrong? Love this program, and it's so helpful in telling when my IP address has changed...
Also fails on 65.255.57.69 if that helps I've done try/except and use set=3 as a workaround, but it'd be nice to use set5
Hi, I have the same issue. Looks like some of the images have "LA" and "RGB" mode causing the issue (as they should be in RGBA mode for manipulating with them keeping transparency):
Here is the the full list of those problematic images which are not in RGBA mode:
/usr/local/lib/python3.7/site-packages/robohash # find . -name "*.png" | python -c "from PIL import Image; import sys; [print(f'{filename.strip()} - {Image.open(filename.s
trip())}') for filename in sys.stdin]" > /tmp/robohash_images
/usr/local/lib/python3.7/site-packages/robohash # cat /tmp/robohash_images | grep -v "mode=RGBA"
./sets/set5/005#FacialHair/FrecklesLight003.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679290>
./sets/set5/005#FacialHair/WrinkleTop.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679290>
./sets/set5/005#FacialHair/FrecklesLight004.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679310>
./sets/set5/005#FacialHair/FrecklesLight001.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679310>
./sets/set5/005#FacialHair/FrecklesLight002.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679310>
./sets/set5/005#FacialHair/Wrinkle.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679310>
./sets/set5/006#Top/WinterHat3-White.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679310>
./sets/set5/006#Top/WinterHat1-White.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679310>
./sets/set5/006#Top/WinterHat2-Brown.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679310>
./sets/set5/006#Top/WinterHat4-White.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679290>
./sets/set5/006#Top/WinterHat3-Brown.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679310>
./sets/set5/006#Top/WinterHat1-Gray01.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679290>
./sets/set5/006#Top/WinterHat2-Gray01.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679290>
./sets/set5/006#Top/LongHairBob-Pink.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679290>
./sets/set5/006#Top/WinterHat4-Brown.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679310>
./sets/set5/006#Top/WinterHat4-Gray01.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679310>
./sets/set5/006#Top/LongHairMiaWallace-Pink.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679310>
./sets/set5/006#Top/WinterHat1-Brown.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679290>
./sets/set5/006#Top/Blank.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679310>
./sets/set5/006#Top/WinterHat3-Gray01.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679310>
./sets/set5/006#Top/WinterHat2-White.png - <PIL.PngImagePlugin.PngImageFile image mode=LA size=1024x1024 at 0x7F61C6679310>
./backgrounds/bg2/005#robotBG-02.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=300x300 at 0x7F61C6679310>
./backgrounds/bg2/001#robotBG-08.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=300x300 at 0x7F61C6679290>
./backgrounds/bg2/000#robotBG-06.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=300x300 at 0x7F61C6679310>
./backgrounds/bg2/002#robotBG-04.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=300x300 at 0x7F61C6679290>
./backgrounds/bg2/003#robotBG-03.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=300x300 at 0x7F61C6679310>
./backgrounds/bg2/004#robotBG-01.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=300x300 at 0x7F61C6679290>
./backgrounds/bg2/006#robotBG-07.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=300x300 at 0x7F61C6679310>
./backgrounds/bg1/012#robotBG-10.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=300x300 at 0x7F61C6679310>
./backgrounds/bg1/007#final7.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=350x350 at 0x7F61C6679290>
./backgrounds/bg1/006#final9.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=350x350 at 0x7F61C6679310>
./backgrounds/bg1/000#robotBG-11.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=300x300 at 0x7F61C6679290>
./backgrounds/bg1/003#final2.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=350x350 at 0x7F61C6679310>
./backgrounds/bg1/010#final8.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=350x350 at 0x7F61C6679310>
./backgrounds/bg1/001#robotBG-12.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=300x300 at 0x7F61C6679290>
./backgrounds/bg1/002#final3.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=350x350 at 0x7F61C6679310>
./backgrounds/bg1/009#final6.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=350x350 at 0x7F61C6679290>
./backgrounds/bg1/005#final5.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=350x350 at 0x7F61C6679310>
./backgrounds/bg1/004#final4.png - <PIL.PngImagePlugin.PngImageFile image mode=RGB size=350x350 at 0x7F61C6679290>
Details on the issue with RGBA: https://stackoverflow.com/questions/31273592/valueerror-bad-transparency-mask-when-pasting-one-image-onto-another-with-pyt
Great catch, thanks!
How tremendously embarrassing, my apologizes! I thought I had fixed this years ago, but it seems I had not. Fixed and merged. Thanks again to @VladimirNT for identifying the issue.