gpt4 book ai didi

ios - -[ALAssetsLibrary writeImageToSavedPhotosAlbum :metadata:completionBlock:] completion block not called

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:09:48 24 4
gpt4 key购买 nike

我正在通过 -[ALAssetsLibrary writeImageToSavedPhotosAlbum:metadata:completionBlock:] 方法保存照片。它主要工作但对于某些照片,根本不会调用完成回调 block 。如果保存失败,它至少应该返回一个 NSError 对象到那个完成 block ,但它没有发生......

有人遇到过这个问题吗?

编辑:

问题似乎出在照片的元数据上。当我将它们设置为 nil 时,它们会正常保存。文档说 您必须在元数据字典中指定方向键以保留图像的方向。检查后,所有照片的元数据都包含方向键...

仍然,应该使用 NSError 触发完成 block 。它可以是一个 Apple Bug 吗?

编辑 2:

对于有兴趣测试的人,这里是一个不起作用的元数据:

{
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;
};
}

最佳答案

删除“2”中的 {MakerApple} 对象。此选项会阻止保存。

关于ios - -[ALAssetsLibrary writeImageToSavedPhotosAlbum :metadata:completionBlock:] completion block not called,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19776164/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com