Avoid Large Images with NSPasteboard

I am working on an application that uses NSPasteboard as an environment that allows users to capture image files from other applications.

Sometimes the user wants to copy a very large image, which can lead to a serious malfunction of the main stream, because cardboard clamps a 30-megabyte file.

Is there a way to set a limit on the size of the data in a cardboard box (and get an error when exceeded) or a way to get the size of the data without touching the data? We cannot request the size of the data from the cardboard, because for this, the file cabinet should already contain large image data (which would be too late).

Thank!

+4
source share

Source: https://habr.com/ru/post/1547098/


All Articles