Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I detect if an imported ALAsset photo was taken via screenshot?

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

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.

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?

like image 269
Guys Avatar asked Oct 22 '22 05:10

Guys


1 Answers

For screenshot, its UTI is always a "public.png" and same size as screen (be sure you have multiply [UIScreen scale] on screen bounds width and height), just need to check these 2 metadata, you can easily identify screenshot.

like image 178
evanchin Avatar answered Oct 25 '22 12:10

evanchin