mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-23 14:05:33 +00:00
78 lines
1.1 KiB
Objective-C
78 lines
1.1 KiB
Objective-C
|
|
|
|
#import "TGCustomImageWallpaperInfo.h"
|
|
|
|
@interface TGCustomImageWallpaperInfo ()
|
|
{
|
|
NSData *_imageData;
|
|
}
|
|
|
|
@end
|
|
|
|
@implementation TGCustomImageWallpaperInfo
|
|
|
|
- (instancetype)initWithImage:(UIImage *)image
|
|
{
|
|
self = [super init];
|
|
if (self != nil)
|
|
{
|
|
if (image != nil)
|
|
_imageData = UIImageJPEGRepresentation(image, 0.98f);
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (NSString *)thumbnailUrl
|
|
{
|
|
return nil;
|
|
}
|
|
|
|
- (NSString *)fullscreenUrl
|
|
{
|
|
return nil;
|
|
}
|
|
|
|
- (int)tintColor
|
|
{
|
|
return 0x000000;
|
|
}
|
|
|
|
- (UIImage *)image
|
|
{
|
|
return [[UIImage alloc] initWithData:_imageData];
|
|
}
|
|
|
|
- (NSData *)imageData
|
|
{
|
|
return _imageData;
|
|
}
|
|
|
|
- (bool)hasData
|
|
{
|
|
return true;
|
|
}
|
|
|
|
- (BOOL)isEqual:(id)object
|
|
{
|
|
if ([object isKindOfClass:[TGCustomImageWallpaperInfo class]])
|
|
{
|
|
return self == object;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
- (NSDictionary *)infoDictionary
|
|
{
|
|
return @{
|
|
@"_className": NSStringFromClass([self class])
|
|
};
|
|
}
|
|
|
|
+ (TGWallpaperInfo *)infoWithDictionary:(NSDictionary *)__unused dict
|
|
{
|
|
return [[TGCustomImageWallpaperInfo alloc] initWithImage:nil];
|
|
}
|
|
|
|
@end
|