我可以检测是否通过屏幕截图获取了导入的ALAsset照片吗? [英] Can I detect if an imported ALAsset photo was taken via screenshot?

查看:101
本文介绍了我可以检测是否通过屏幕截图获取了导入的ALAsset照片吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 imagePickerController ,用于将照片从库导入我的应用程序。

I have an imagePickerController that is used for importing photos from library into my app.

当进入 ALAssetsLibraryAssetForURLResultBlock ,我试图找出我在块中的ALAsset是照片拍摄的照片还是真正的照片,拍摄的照片通过相机。

When in ALAssetsLibraryAssetForURLResultBlock, I'm trying to find out if the ALAsset I've got in the block is a photo taken as a screen-shot or is it a "genuine" photo, taken by the camera.

我试图通过ALAsset的元数据字典但找不到任何适合的标志/指示。

I've tried to go through the ALAsset's metadata dictionaries but couldn't find any flag / indication that might fit.

任何人都有任何想法吗?

Anyone have any ideas?

推荐答案

嗯,我正在研究和试验..而且最近我发现的解决方案是基于这样的事实:iPhone屏幕截图不会产生EXIF记录(而所有其他生成的照片都会生成它们)。

Well, I was researching and experimenting .. and the closest solution I've found is based on the fact that iPhone screenshots don't yield EXIF records (while all other generated photos do generate them).

因此,一旦在选择器中选择了一张照片,我就会检查照片的元数据是否包含EXIF记录,如果没有 - 我得出结论照片截图。

Therefore, once a photo is selected in the picker, I'm checking if the photo's metadata consists an EXIF record and if it doesn't - I conclude that the photo was screenshot.

我发现它现在的解决方案尽可能好,虽然它不是正式的。

I found it's the "as good as it gets" solution for now, although it's not an official one.

干杯。

这篇关于我可以检测是否通过屏幕截图获取了导入的ALAsset照片吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆