title: Error while saving JPG/PNG photo to gallery in IOS 11
body: <p>I was testing our application on new device with beta iOS 11 and found an intresting error.
  We are creating an image which can be saved to user gallery, using UIActivityViewController (some system share view controller):</p>
  <pre><code>NSMutableArray *sharingItems = [NSMutableArray new];
  UIImage *screenShot = [self shareViewScreenShot];
  NSString *filename = @&quot;notImportant&quot;;
  NSString *path = [NSString stringWithFormat:@&quot;%@%@.jpg&quot;, NSTemporaryDirectory(), filename];
  [UIImageJPEGRepresentation(screenShot, 1.0) writeToFile:path atomically:YES];
  NSURL *pathUrl = [NSURL fileURLWithPath:path];
  [sharingItems addObject:pathUrl];
  
  UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:sharingItems applicationActivities:nil];
  [self presentViewController:activityController animated:YES completion:nil];
  </code></pre>
  <p><a href="https://i.stack.imgur.com/6py6P.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6py6P.png" alt="share dialog" /></a></p>
  <p>This works fine, presenting share dialog, until user press &quot;save image&quot;. Then I got error about not suporting this image format</p>
  <blockquote>
  <p>2017-07-19 10:51:54.292881+0200 appName[6632:766119] Video
  /private/var/mobile/Containers/Data/Application/29B8C33B-9247-45FE-B51F-A35A035019A9/tmp/notImportant.jpg
  cannot be saved to the saved photos album: Error
  Domain=AVFoundationErrorDomain Code=-11828 &quot;Nie można otworzyć&quot;
  UserInfo={NSUnderlyingError=0x1c08558d0 {Error
  Domain=NSOSStatusErrorDomain Code=-12847 &quot;(null)&quot;},
  NSLocalizedFailureReason=Ten format multimediów nie jest obsługiwany.,
  NSURL=file:///private/var/mobile/Containers/Data/Application/29B8C33B-9247-45FE-B51F-A35A035019A9/tmp/notImportant.jpg,
  NSLocalizedDescription=Nie można otworzyć}</p>
  </blockquote>
  <p>The same happens when I use png/UIImagePNGRepresentation.
  So the questions are:</p>
  <ol>
  <li><p>Are png/jpg supported in iOS 11?</p>
  </li>
  <li><p>Should I use/and how HEIF (new apple image format) for devices with os version &gt;= 11?</p>
  </li>
  </ol>