Do not declare NSPasteboardTypePNG.
This commit is contained in:
1 parent
8b29f559f5
commit
7dcf857660
1 file changed
+3
-3
@@ -881,15 +881,15 @@ static NSArray<NSArray *> *_mediaKinds;
|
|||||||
|
|
||||||
- (NSUInteger)imageBrowser:(IKImageBrowserView *)aBrowser writeItemsAtIndexes:(NSIndexSet *)itemIndexes toPasteboard:(NSPasteboard *)pasteboard
|
- (NSUInteger)imageBrowser:(IKImageBrowserView *)aBrowser writeItemsAtIndexes:(NSIndexSet *)itemIndexes toPasteboard:(NSPasteboard *)pasteboard
|
||||||
{
|
{
|
||||||
[pasteboard declareTypes:@[SublerCoverArtPBoardType, NSPasteboardTypePNG] owner:nil];
|
[pasteboard declareTypes:@[SublerCoverArtPBoardType, NSPasteboardTypeTIFF] owner:nil];
|
||||||
|
|
||||||
for (MP42MetadataItem *item in [self.artworks objectsAtIndexes:itemIndexes]) {
|
for (MP42MetadataItem *item in [self.artworks objectsAtIndexes:itemIndexes]) {
|
||||||
MP42Image *image = item.imageValue;
|
MP42Image *image = item.imageValue;
|
||||||
if (image) {
|
if (image) {
|
||||||
NSArray *representations = image.image.representations;
|
NSArray *representations = image.image.representations;
|
||||||
if (representations) {
|
if (representations) {
|
||||||
NSData *bitmapData = [NSBitmapImageRep representationOfImageRepsInArray:representations usingType:NSBitmapImageFileTypePNG properties:@{}];
|
NSData *bitmapData = [NSBitmapImageRep representationOfImageRepsInArray:representations usingType:NSBitmapImageFileTypeTIFF properties:@{}];
|
||||||
[pasteboard setData:bitmapData forType:NSPasteboardTypePNG];
|
[pasteboard setData:bitmapData forType:NSPasteboardTypeTIFF];
|
||||||
}
|
}
|
||||||
[pasteboard setData:[NSKeyedArchiver archivedDataWithRootObject:image] forType:SublerCoverArtPBoardType];
|
[pasteboard setData:[NSKeyedArchiver archivedDataWithRootObject:image] forType:SublerCoverArtPBoardType];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user