2

という方法で写真を保存してい-[ALAssetsLibrary writeImageToSavedPhotosAlbum:metadata:completionBlock:]ます。大部分は機能しますが、一部の写真では、完了コールバック ブロックがまったく呼び出されません。保存が失敗した場合、少なくともNSErrorその完了ブロックにオブジェクトを返す必要がありますが、それは起こっていません...

誰かがすでにこの問題に直面していますか?

編集 :

問題は写真のメタデータにあるようです。に設定するとnil、正常に保存されます。ドキュメントにはYou must specify the orientation key in the metadata dictionary to preserve the orientation of the image. 、確認後、すべての写真のメタデータに方向キーが含まれていると記載されています...

それでも、完了ブロックはNSError. それはAppleのバグですか?

編集2:

テストに興味がある人のために、機能しないメタデータの 1 つを次に示します。

{
    ColorModel = RGB;
    DPIHeight = 72;
    DPIWidth = 72;
    Depth = 8;
    Orientation = 1;
    PixelHeight = 2448;
    PixelWidth = 3264;
    "{Exif}" =     {
        ApertureValue = "2.275007124536905";
        BrightnessValue = "-2.881004847950639";
        ColorSpace = 1;
        ComponentsConfiguration =         (
            1,
            2,
            3,
            0
        );
        DateTimeDigitized = "2013:10:15 18:52:49";
        DateTimeOriginal = "2013:10:15 18:52:49";
        ExifVersion =         (
            2,
            2,
            1
        );
        ExposureMode = 0;
        ExposureProgram = 2;
        ExposureTime = "0.06666666666666667";
        FNumber = "2.2";
        Flash = 16;
        FlashPixVersion =         (
            1,
            0
        );
        FocalLenIn35mmFilm = 30;
        FocalLength = "4.12";
        ISOSpeedRatings =         (
            1250
        );
        LensMake = Apple;
        LensModel = "iPhone 5s back camera 4.12mm f/2.2";
        LensSpecification =         (
            "4.12",
            "4.12",
            "2.2",
            "2.2"
        );
        MeteringMode = 5;
        PixelXDimension = 3264;
        PixelYDimension = 2448;
        SceneCaptureType = 0;
        SceneType = 1;
        SensingMethod = 2;
        ShutterSpeedValue = "3.907099697885196";
        SubsecTimeDigitized = 697;
        SubsecTimeOriginal = 697;
        WhiteBalance = 0;
    };
    "{GPS}" =     {
        Altitude = "15.52868632707775";
        AltitudeRef = 0;
        DateStamp = "2013:10:15";
        ImgDirection = "151.5822510822511";
        ImgDirectionRef = T;
        Latitude = "41.90171166666666";
        LatitudeRef = N;
        Longitude = "12.45707";
        LongitudeRef = E;
        TimeStamp = "16:52:48";
    };
    "{MakerApple}" =     {
        1 = 0;
        11 = "7B01259E-B768-4F22-AFE6-D2D33F5D4FC2";
        2 = <a100a600 ae00b600 bc00b500 ab007d00 a100c700 aa00a400 96008800 86007800 9f00a000 9f00a000 a2009200 86007000 7b009400 84008400 72007600 7f008600 7d008300 86008500 80007b00 72007300 68006000 78008000 8c008600 81009300 6f007000 74007200 70007a00 7d007e00 71006e00 7a007800 74008300 af009400 85007a00 72006f00 6b006200 5c008e00 62006000 78009400 92009300 c5009500 a200b700 8d007f00 82006500 6d00ad00 67007c00 79008a00 88008f00 e5009b00 a600c100 79006b00 6e005900 7f00eb00 5e009e00 75008900 8e008f00 4001a800 f6003e01 8a006c00 7d005700 a600d501 5c00c200 7500b900 b4008e00 2c019d00 2c012f01 ba007100 94005500 d0003f02 5600e000 71003001 66019500 1e019000 79007300 85006000 55004500 93002501 48006600 49006e00 c4007900 e7008100 6e006e00 7f005b00 35003600 40003500 28002300 2a003100 30003700 3d004300 4e004b00 48003800 2c002b00 16000800 0f002500 28002d00 2b002900 29002900 28002800 2b002b00 2f001700 15000700 17001400 26003100 31002e00 31002f00 28002800 28002800 28001800 11000700 21002900 2b002b00 29002c00 2e002e00 26002400 25002500 25001800 0d000700 20002700 27002700 29002a00 2b002b00 24002400 25002200 22002100 22001600 21002400 23002400 26002600 28002700>;
        3 =         {
            epoch = 0;
            flags = 1;
            timescale = 1000000000;


          value = 108598355094541;
        };
        4 = 1;
        5 = 101;
        6 = 104;
        7 = 0;
    };
    "{TIFF}" =     {
        DateTime = "2013:10:15 18:52:49";
        Make = Apple;
        Model = "iPhone 5s";
        Orientation = 1;
        ResolutionUnit = 2;
        Software = "7.0.2";
        XResolution = 72;
        YResolution = 72;
    };
} 
4

1 に答える 1