• inoddy

    Apple says that we must use Xcode 6, iOS 8 SDK, and apps must have 64bit support

    https://developer.apple.com/news/?id=10202014a

    posted in Pythonista read more
  • inoddy

    When using scene.image to draw iconicons they appear black. Using scene.tint makes no difference. I would like them to appear blue. Any ideas?

    A workaround is to use ui Buttons. But it seems overkill to use buttons just to draw a passive icon.

    from scene import *
    
    class MyScene (Scene):
        
        def draw(self):
            background(1, 1, 0)
            tint(0, 0, 1)
            image('ionicons-checkmark-circled-32', 300, 300)
        
    run(MyScene())

    posted in Pythonista read more
  • inoddy

    This works

    from scene import *
    from PIL import Image
    
    class MyScene (Scene):
        def setup(self):
            img = Image.open('ionicons-arrow-down-c-256').convert('RGBA')
            red, green, blue, alpha = img.split()
            img = Image.merge('RGBA', (red, green, alpha, alpha))
            self.img = load_pil_image(img)
    
        def draw(self):
            background(1,1,0)
            image(self.img, 300, 300)
    
    run(MyScene())
    

    It's still a bit inefficient. The ionicon is opened as an LA image. I convert it to RGBA because Image.split() does not work with LA images - it would be good if I could extract the alpha without the RGB conversion.

    posted in Pythonista read more
  • inoddy

    That works quite well (if a little slow - precaching is a good idea).

    I still can't help thinking that there is a better way since ui seems to do it quickly.

    Thanks for the help.

    posted in Pythonista read more
  • inoddy

    This bug has been reported before - Windows style carriage returns can cause Pythonista to crash. The report said that happened when using the delete key. I have found that too. But also I have found the crash simply upon opening a script.

    The interesting bit is that it was only a small section of code that caused the crash. Deleting a couple of lines on a PC avoided the crash.

    If you want a copy of the file I can supply it as a zip archive.

    posted in Pythonista read more
  • inoddy

    Did you have something specific in mind? I tried this:

    from scene import *
    from PIL import Image
    from PIL import ImageOps
    
    class MyScene (Scene):
        
        def draw(self):
            background(1, 1, 0)
            tint(0, 0, 1)
            img = Image.open('ionicons-arrow-down-c-32').convert('L')
            img = ImageOps.colorize(img, 'blue', 'white').convert('RGBA')
            img = load_pil_image(img)
            image(img, 300, 300)
        
    run(MyScene())
    

    but it coloured the whole box blue instead of the part of the icon that I wanted blue. I hope there's something better than grabbing all the pixels and changing them individually.

    posted in Pythonista read more
  • inoddy

    Apple removed the Camera Roll in iOS 8. So what does photos.get_image do? Does it still work? Similarly for the other functions that access the Camera Roll?

    posted in Pythonista read more
  • inoddy

    Thanks for the suggestions. In the end I decided to use the first method. A little slow but it worked.

    posted in Pythonista read more
  • inoddy

    I want to crop the images used in the Cards.py example. But I can't figure out how.

    Do I do it in the line

    card.card_image = images[i]

    or the line

    card.image = card.card_image

    and if so then how?

    I've tried everything I can think of: Image.crop, ImageOps.crop, card.crop, card.card_image.crop, card.image.crop, images[i].crop but I appear to be missing something

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!