How to resolve the PhotoKit error “Original resource choice is only valid for an unadjusted base version”? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experience Should we burninate the [wrap] tag?In PhotoKit, modifying PHAsset leaves original around. How? Overridable?How to display specific array based on choice from previous controllerHow to resolve this error? - Class 'ViewController' has no initializersAdding or overwriting GPS metadata without losing any other data and save with PHPhotoLibraryHow to conform to a protocol based on OS version ?GLKView.display() method sometimes causes crash. EXC_BAD_ACCESSEureka Forms Hide validation errors based on SegmentedRow“Only valid bearer authentication supported” - error 400How to resolve a variable in Kotlin, based on IOS solution?How can you get Original Application Version in Production?

When -s is used with third person singular. What's its use in this context?

Is there a "higher Segal conjecture"?

3 doors, three guards, one stone

Why is "Consequences inflicted." not a sentence?

Center align columns in table ignoring minus signs?

If 'B is more likely given A', then 'A is more likely given B'

The logistics of corpse disposal

Do you forfeit tax refunds/credits if you aren't required to and don't file by April 15?

What are the motives behind Cersei's orders given to Bronn?

Can a non-EU citizen traveling with me come with me through the EU passport line?

Why was the term "discrete" used in discrete logarithm?

When to stop saving and start investing?

Sorting numerically

Why don't the Weasley twins use magic outside of school if the Trace can only find the location of spells cast?

Gastric acid as a weapon

Is a manifold-with-boundary with given interior and non-empty boundary essentially unique?

Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?

Is it true that "carbohydrates are of no use for the basal metabolic need"?

What is this single-engine low-wing propeller plane?

Are my PIs rude or am I just being too sensitive?

Does surprise arrest existing movement?

Why did the IBM 650 use bi-quinary?

Why constant symbols in a language?

Why are there no cargo aircraft with "flying wing" design?



How to resolve the PhotoKit error “Original resource choice is only valid for an unadjusted base version”?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experience
Should we burninate the [wrap] tag?In PhotoKit, modifying PHAsset leaves original around. How? Overridable?How to display specific array based on choice from previous controllerHow to resolve this error? - Class 'ViewController' has no initializersAdding or overwriting GPS metadata without losing any other data and save with PHPhotoLibraryHow to conform to a protocol based on OS version ?GLKView.display() method sometimes causes crash. EXC_BAD_ACCESSEureka Forms Hide validation errors based on SegmentedRow“Only valid bearer authentication supported” - error 400How to resolve a variable in Kotlin, based on IOS solution?How can you get Original Application Version in Production?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I try to add IPTC, TIFF and EXIF data to an PHAsset. When I apply changes with the following code snipped I got the mentioned error:



guard let ciImage = CIImage(contentsOf: input.fullSizeImageURL!, options: [.applyOrientationProperty:true]) else 
fatalError("Not able to create CIImage from input")


//Write the edited image as a JPEG.
do
try CIContext().writeJPEGRepresentation(of: ciImage,
to: output.renderedContentURL,
colorSpace: outputImage.colorSpace!,
options: [kCGImageDestinationLossyCompressionQuality as CIImageRepresentationOption:1.0])

catch let error
fatalError("Can't apply metadata to the image: (error).")


PHPhotoLibrary.shared().performChanges(
let request = PHAssetChangeRequest(for: self.asset!)
request.contentEditingOutput = output
, completionHandler: success, error in
if !success
print("Can't edit the asset: (error?.localizedDescription)")




Error:



[PhotoKit] Original resource choice is only valid for an unadjusted base version


What am I doing wrong? Is there a better way to add IPTC metadata to a PHAsset, resp. UIImage file?










share|improve this question




























    0















    I try to add IPTC, TIFF and EXIF data to an PHAsset. When I apply changes with the following code snipped I got the mentioned error:



    guard let ciImage = CIImage(contentsOf: input.fullSizeImageURL!, options: [.applyOrientationProperty:true]) else 
    fatalError("Not able to create CIImage from input")


    //Write the edited image as a JPEG.
    do
    try CIContext().writeJPEGRepresentation(of: ciImage,
    to: output.renderedContentURL,
    colorSpace: outputImage.colorSpace!,
    options: [kCGImageDestinationLossyCompressionQuality as CIImageRepresentationOption:1.0])

    catch let error
    fatalError("Can't apply metadata to the image: (error).")


    PHPhotoLibrary.shared().performChanges(
    let request = PHAssetChangeRequest(for: self.asset!)
    request.contentEditingOutput = output
    , completionHandler: success, error in
    if !success
    print("Can't edit the asset: (error?.localizedDescription)")




    Error:



    [PhotoKit] Original resource choice is only valid for an unadjusted base version


    What am I doing wrong? Is there a better way to add IPTC metadata to a PHAsset, resp. UIImage file?










    share|improve this question
























      0












      0








      0








      I try to add IPTC, TIFF and EXIF data to an PHAsset. When I apply changes with the following code snipped I got the mentioned error:



      guard let ciImage = CIImage(contentsOf: input.fullSizeImageURL!, options: [.applyOrientationProperty:true]) else 
      fatalError("Not able to create CIImage from input")


      //Write the edited image as a JPEG.
      do
      try CIContext().writeJPEGRepresentation(of: ciImage,
      to: output.renderedContentURL,
      colorSpace: outputImage.colorSpace!,
      options: [kCGImageDestinationLossyCompressionQuality as CIImageRepresentationOption:1.0])

      catch let error
      fatalError("Can't apply metadata to the image: (error).")


      PHPhotoLibrary.shared().performChanges(
      let request = PHAssetChangeRequest(for: self.asset!)
      request.contentEditingOutput = output
      , completionHandler: success, error in
      if !success
      print("Can't edit the asset: (error?.localizedDescription)")




      Error:



      [PhotoKit] Original resource choice is only valid for an unadjusted base version


      What am I doing wrong? Is there a better way to add IPTC metadata to a PHAsset, resp. UIImage file?










      share|improve this question














      I try to add IPTC, TIFF and EXIF data to an PHAsset. When I apply changes with the following code snipped I got the mentioned error:



      guard let ciImage = CIImage(contentsOf: input.fullSizeImageURL!, options: [.applyOrientationProperty:true]) else 
      fatalError("Not able to create CIImage from input")


      //Write the edited image as a JPEG.
      do
      try CIContext().writeJPEGRepresentation(of: ciImage,
      to: output.renderedContentURL,
      colorSpace: outputImage.colorSpace!,
      options: [kCGImageDestinationLossyCompressionQuality as CIImageRepresentationOption:1.0])

      catch let error
      fatalError("Can't apply metadata to the image: (error).")


      PHPhotoLibrary.shared().performChanges(
      let request = PHAssetChangeRequest(for: self.asset!)
      request.contentEditingOutput = output
      , completionHandler: success, error in
      if !success
      print("Can't edit the asset: (error?.localizedDescription)")




      Error:



      [PhotoKit] Original resource choice is only valid for an unadjusted base version


      What am I doing wrong? Is there a better way to add IPTC metadata to a PHAsset, resp. UIImage file?







      ios swift phasset photokit






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 8 at 16:11









      sn3eksn3ek

      1,33411830




      1,33411830






















          1 Answer
          1






          active

          oldest

          votes


















          0














          If found the issue which was in the code before I created the CIImage shown in my question. I deleted the code and instead of overriding the binary data of the CIImage I just use the CIImage to store my changes in the PHAsset / PHAssetLibrary.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55066960%2fhow-to-resolve-the-photokit-error-original-resource-choice-is-only-valid-for-an%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            If found the issue which was in the code before I created the CIImage shown in my question. I deleted the code and instead of overriding the binary data of the CIImage I just use the CIImage to store my changes in the PHAsset / PHAssetLibrary.






            share|improve this answer



























              0














              If found the issue which was in the code before I created the CIImage shown in my question. I deleted the code and instead of overriding the binary data of the CIImage I just use the CIImage to store my changes in the PHAsset / PHAssetLibrary.






              share|improve this answer

























                0












                0








                0







                If found the issue which was in the code before I created the CIImage shown in my question. I deleted the code and instead of overriding the binary data of the CIImage I just use the CIImage to store my changes in the PHAsset / PHAssetLibrary.






                share|improve this answer













                If found the issue which was in the code before I created the CIImage shown in my question. I deleted the code and instead of overriding the binary data of the CIImage I just use the CIImage to store my changes in the PHAsset / PHAssetLibrary.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 8 at 17:56









                sn3eksn3ek

                1,33411830




                1,33411830





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55066960%2fhow-to-resolve-the-photokit-error-original-resource-choice-is-only-valid-for-an%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    1928 у кіно

                    Захаров Федір Захарович

                    Ель Греко