fastlane-old / snapshot

Automate taking localized screenshots of your iOS app on every device
https://fastlane.tools
1.95k stars 140 forks source link

Orientation grouping #336

Closed OSemenovBoyarka closed 8 years ago

OSemenovBoyarka commented 9 years ago

Really sorry for screenshots duplication issue in #335. This pull request fixes that and now all should work fine. As for me it works :)

Also this will setup valid UIDeviceOrientation after calling snapshot. Because previously - orientation was still .Unknown even after simulator reboot.

OSemenovBoyarka commented 8 years ago

@KrauseFx would you have chance to look through this changes and merge them if all is ok? Currently I'm using it, but it's not very nice to use non-official gem version on build server :)

OSemenovBoyarka commented 8 years ago

I've merged this PR brach with latest master, tested and it works absolutely fine for me. Guys, please, look though it :)

FYI - this require update of SnapshotHelper.swift

KrauseFx commented 8 years ago

I'm unsure about the SnapshotHelper.swift update. Most existing users won't update their SnapshotHelper.swift, will this still work then? What happens if you have an old helper file?

OSemenovBoyarka commented 8 years ago

Unfortunately, I haven't found better way to detect orientation, than marking it explicitly in filename. We can detect image proportions on final collect stage, directly from image files, but I'm afraid it will take too much time.

As for using with old SnapshotHelper - no problem, it will work as before, just will not group screenshots by orientation. Just checked.

i2amsam commented 8 years ago

@SemenovAlexander I'm going to close this as we're moving to a mono repo very shortly. I like the idea of detecting orientation from the file size of the output image, I wonder if there's a minimagic way getting the image size and just assuming that anything wider than it is all is portrait.