• coomlata1

    @JonB...Thanks much for the useful information. I’ll follow up on your suggestions and see where Objective C and PHImageManager leads me. Hopefully I will have some useful code to present in the near future.

    posted in Pythonista read more
  • coomlata1

    @ JonB...Thanks for the response. I'm importing image, imagefont, and imagedraw from PIL and using them to open, resize, reorient if necessary, and then stamp GPS data to bottom of photo before copying it to a folder in dropbox. User has the option to retain the metadata in the Dropbox copy. Full code is here.

    I can get the metadata from the heic photo without problems, but PIL chokes on the photo during the opening and resizing, so I'm bypassing any that exist in the camera roll when I run the script.

    As I have thought about this more, I would prefer to keep the camera roll photos in heic format, rather than converting to jpeg, due to the more efficient storage capabilities. I imagine that PIL or Pillow will be updated to accommodate heic at some point in the future.

    posted in Pythonista read more
  • coomlata1

    With the introduction of iOS11, photos on the iPhone camera roll are stored in .heic format rather than jpg. Anyone have any thoughts on:

    1. How to retrieve metadata from the .heic photo files using pythonista
    2. How to convert said files from .heic to jpg format using pythonista

    You can set the iPhone camera to store pics in jpeg format in iOS11 by selecting 'Camera' in settings, selecting 'Format', and changing the setting from 'High Efficiency' to 'Most Compatible'. Downside to this is the larger storage size using jpeg and video quality will suffer.

    I would prefer to use the heic format, but most third party modules that work with images don't yet support heic.

    posted in Pythonista read more
  • coomlata1

    @Treenjood

    I wrote a script that converts the pyui attributes into text for copying into a py file as code. I will take a bit of manipulation to convert over some of the attributes, but it should help get you started. The code is available here.

    posted in Pythonista read more
  • coomlata1

    @markhamilton1
    Set up the app in dropbox as per your instructions. When I run the Sycronator script I get an error: 'FileMetaData object has no attribute 'content_hash'. I am using the app store version of Pythonista 2.11. Is the script designed to run in Pythonista 3? What directory does the script belong in, it's own, or the Pythonista root directory? I assume the DropboxSetup script goes in the site-packages folder where it can be imported by other scripts that need Dropbox access.

    posted in Pythonista read more
  • coomlata1

    Added this script to my GitHub repository. It extends the capabilities of the @lukaskollmer script and provides support for editing existing code header comments in scripts. Suggestions and improvements are always welcome.

    posted in Pythonista read more
  • coomlata1

    @nekotaroneko Thank you for the information. I have updated my script acknowledgements to reflect this.

    posted in Pythonista read more
  • coomlata1

    I have posted a script on my GitHub repository that expands the use of the GUI_Helper.py file. It is available here. The script uses the excellent file picker code in GUI_Helper.py to browse and select a pyui file in the Pythonista documents directory, and then returns a text file of the attributes of the view and subviews in the selected pyui file for copying into the code of a .py file. The text is displayed in the Pythonista console and copied to the clipboard. This allows for an easy transition from two seperate files into a single .py file when using a ui.

    posted in Pythonista read more
  • coomlata1

    to @jmv38...How, specifically in code, did you replace super() in @Phuket2 code, to get this to work in Pythonista 2.x.

    posted in Pythonista read more
  • coomlata1

    Updated script using the new photos module attributes and the info provided to me by @JonB @omz and @cvp is now available here.

    posted in Pythonista read more
  • coomlata1

    @JonB @omz @cvp

    Thank you for the information and code snippets. That's just what I needed to rewrite a script written several years ago using the old photo module attributes. Much appreciated!!!

    posted in Pythonista read more
  • coomlata1

    I would like to retrieve the filenames of photos from the iPhone camera roll. I can get the local id of a photo or collection of photos using the asset.local_id property, but that is a long string of letters and numbers, not the actual filename. I have found nothing in the documentation that would help. There must be a get_filename property that I am missing.

    I could get the filenames in the Pythonista 2 and earlier photos module using photos.get_metadata(index).get('filename') but that doesn't work when using the new asset properties of the photos module in Pythonista 2.1.

    The orientation of photo was available in the metadata using get('Orientation') but I don't know how to access this using the new photos module.

    Any help is greatly appreciated.

    posted in Pythonista read more
  • coomlata1

    I tried to install agate 1.3.1 in pythonista 2.1 using stash but I get an error with "stash: <class '_main.PyPiError'>: 'No package found with that name'. I can install agate 1.2.0 without errors and I can at least get an attempt to install 1.4 but, as noted above, it errors out, due to dependencies. I searched in the PyPi index and could not find agate 1.3.1 listed. Earlier versions prior to 1.2.0 are listed as well as 1.2.0 and 1.4.0 but no 1.3.1.

    Finally gave up on pip install and ended up manually installing agate 1.3.1 with stash using the URL from an earlier post in this thread by @korakot: https://pypi.python.org/packages/c0/75/7a4749bb393846adb58bad5044fb8f32738def6c0d5a2bc7f46180f45582/agate-1.3.1.tar.gz .

    posted in Pythonista read more
  • coomlata1

    @Webmaster4o
    Thank you...good to know.

    posted in Editorial read more
  • coomlata1

    @tf2
    Hi...I wrote a Pythonista script last year that gets the orientation info you are looking for out of the photo's meta data. The script captures all the meta data from the photo(s) you select and copies the photo(s) and the meta data back to dropbox. You have to capture this info after you select, but before you copy the image. I too looked for ways to do this in lots of scripts and workflows but could find nothing. All the workflows-scripts I found stripped all the meta data before copying the image to the desired destination. I eventually chose to work entirely from Pythonista. The script I wrote is available via a repo in GitHub here.

    While I have more experience with Pythonista than Editorial, I might be able to help you find a solution if you could post what you have so far in terms of the scripting for your workflow.

    posted in Editorial read more
  • coomlata1

    On my iPhone 6+ the status bar and view both stay locked.

    posted in Pythonista read more
  • coomlata1

    The first line in my imports was:

    'from future import(absolute_import, division, print_function, unicode_literals)'

    After removing that line, the orientation worked as expected and stayed locked in portrait mode. That line was put in early last year to aid in being forward compatible with Python 3 changes. The script was console based at that time with no ui.

    Thanks again for your comments...great forum.

    posted in Pythonista read more
  • coomlata1

    The last 2 lines were a copy paste error. I copied the exact code to a blank script and ran it. The orientation is still not locked. I am using an iPhone 6+. I tried hard coding the frame size ...self.frame = (0, 0, 414, 736), but that didn't work either. My next thought would be to create a pyui file and load it with ui.load_view(). I read your comment about not needing a class for this. Maybe that would make a difference. Obviously I've got some things to learn. Thanks for all your input...much appreciated.

    posted in Pythonista read more
  • coomlata1

    Here is the code that presents the ui I talked about in my above post. The orientation does not stay in portrait mode.

    class MyView(ui.View):
      def __init__(self):
        self.width, self.height = ui.get_screen_size()
        self.background_color = 'orange'
    
        # Accomodate iPhone 6p and smaller phones as well
        if is_iP6p():
          self.tf1 = ui.TextField(frame = (20, 80, 380, 50))
          self.tf2 = ui.TextField(frame = (70, 180, 275, 50))
          self.lb1 = ui.Label(frame = (70, 35, 275, 50))
          self.lb2 = ui.Label(frame = (70, 135, 275, 50))
          self.iv = ui.ImageView(frame = (55, 270, 300, 300))
        else:
          self.tf1 = ui.TextField(frame = (20, 80, 280, 50))
          self.tf2 = ui.TextField(frame = (70, 180, 175, 50))
          self.lb1 = ui.Label(frame = (25, 35, 275, 50))
          self.lb2 = ui.Label(frame = (20, 135, 275, 50))
          self.iv = ui.ImageView(frame = (45, 235, 225, 225))
    
        self.tf1.bordered = False
        self.tf1.background_color = 'cyan'
        self.tf1.corner_radius = 10
        self.tf1.font = ('<system-bold>', 16)
        self.tf1.flex = "WHLRTB"
        self.tf1.clear_button_mode = 'while_editing'
        self.tf1.delegate = self
    
        self.tf2.bordered = False
        self.tf2.background_color = 'cyan'
        self.tf2.corner_radius = 10
        self.tf2.font = ('<system-bold>', 16)
        self.tf2.flex = 'WHLRTB'
        self.tf2.clear_button_mode = 'while_editing'
        self.tf2.keyboard_type = ui.KEYBOARD_NUMBER_PAD
    
        self.lb1.alignment = ui.ALIGN_CENTER
        self.lb1.text = 'Enter A Movie Or TV Series Title:'
        self.lb1.font = ('<system-bold>', 18)
        self.lb1.flex = 'WHLRTB'
    
        self.lb2.alignment = ui.ALIGN_CENTER
        self.lb2.text = 'Enter Year Of Release If Known:'
        self.lb2.font = ('<system-bold>', 18)
        self.lb2.flex = 'WHLRTB'
    
        self.iv.image = ui.Image.named('thin_blue_line.gif')
    
        self.add_subview(self.tf1)
        self.add_subview(self.tf2)
        self.add_subview(self.lb1)
        self.add_subview(self.lb2)
        self.add_subview(self.iv)
        self.flex = 'WHLRTB'
        #self.tf1.begin_editing()
        v = MyView()
        v.present(style = 'full_screen', orientations = ['portrait'])
    

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!