Until very recently I had never used a Photo Editing Extension. But now that I’ve built Zoom Burst, I wanted describe the steps involved in opening a photo editing extension.
Step 1. Open the photos app and select a photo
Step 2. Tap edit.
Step 3. Tap the circle with three dots. (in the top right corner of the screen)
Step 4. Select the editing extension of your choice. (eg ZoomBurst)
I’ve been enjoying playing with a Zoom Burst new photo editing extension that I’ve been building. It lets me add zoom burst effects to photos. If you don’t know what zoom burst is, I recommend you read this great article by Dahlia Ambrose. Or if you’d prefer, Wikipedia offers a great introduction. Before creating my Zoom Burst photo editing extension you needed an SLR (digital or otherwise) and a zoom lens to create zoom burst photos.
The procedure was:
Set your shutter speed to 1/60th of a second or longer
Press the shutter release in concert with changing the zoom focal length of the lens
In particular I really enjoyed creating zoom burst photos of lights at night. In early December, it felt like any time I saw Christmas lights, I wished I could create a zoom burst photo. Alas.
Now thanks to the miracle of Core Image, I’m able to convert this:
Into this:
I have been focussing my initial Zoom Burst efforts on getting it to work with photos of lights at night. I’m cautiously optimistic I’ll be able to extend it to also work with non-night photos. In the meantime, here are a few other photos before and after applying Zoom Burst.
Before
After
I think the controls in the Zoom Burst extension are fairly easy to figure out, but I’ve created a short tutorial, that is available here.
I had a bit of trouble organically discovering how to use a Photo Editing Extension. To prevent you from fumbling around like me, here is a list of instructions to open/use a Photo Editing Extension.
I recently wanted to create some content that would sometimes display in an HStack and sometimes in a VStack. The content was the same in both cases, so I wanted to avoid doing:
Fortunately, I was able to use a ViewBuilder to contain the contents of the stacks.
@ViewBuilder var stackContents: some View {
thing1
thing2
}
...
if goVertical {
VStack {
contents
.padding(.horizontal)
}
} else {
HStack {
contents
}
}
So far so good. (Aside: Am I the only one who didn’t know @ViewBuilder can be used to return a list of SwiftUI views?!) However I eventually got myself into a bit of trouble with my stack contents in an interesting way. Here are the details.
First you need to know that thing1 is an image and thing 2 is a VStack of sliders, steppers and such. Here’s how the view looks in portrait and landscape.
BUT… since I will be adding more sliders, steppers and such, I moved them into a ScrollView. But (as you can see on the right) when I did this, The ScrollView took more height than it needed and short changed the Image.
My first thought was in use a layoutPriority modifier on the image, but this had no effect, so I removed it. Next, I tried adding background modifiers to the VStack contents, and that proved to be very illuminating. (see below)
Applying horizontal padding to contents did not apply it once, it (presumably) iterated through all the items in contents and applied the padding to each item in contents.
I moved the padding (and background modifiers to apply to the VStack, instead of contents
Great, this looks more like what I was expecting with the padding. But the image is still narrower.
So I re-added the layoutPriority modifier to the image, and that did the trick. I still don’t understand why the ScrollView ‘steals’ vertical space from the Image. (And maybe one day I’ll better understand what causes me to anthropomorphize SW modules like layout engines.)
The interesting thing for me in this issue was how doing something incorrectly (ie applying the horizontal padding to the contents of the VStack, rather than to the VStack) worked correctly at first, but when the butterfly flapped its wings (ie one of the elements in contents was wrapped in a ScrollView) the wheels fell off.
Encountering and eventually overcoming this type of problem is a big part of the ecstasy and the agony of writing software.