This repository has been archived by the owner on Apr 8, 2024. It is now read-only.
SpectrumKit not working in the case when you pass parameter with screenshot image but working fine with actual image. size(720,720), quality 80. #206
Labels
+(NSData*)spectrumData:(UIImage *)image size:(CGSize)size quality:(CGFloat)quality {
FSPEncodeRequirement *encodeRequirement =
[FSPEncodeRequirement encodeRequirementWithFormat:FSPEncodedImageFormat.jpeg
mode:FSPEncodeRequirementModeLossy
quality:quality];
FSPTransformations *transformations = [FSPTransformations new];
transformations.resizeRequirement =
[[FSPResizeRequirement alloc] initWithMode:FSPResizeRequirementModeExactOrSmaller
targetSize:size];
FSPConfiguration * configuration = [[FSPConfiguration alloc]init];
FSPEncodeOptions *options =
[FSPEncodeOptions encodeOptionsWithEncodeRequirement:encodeRequirement
transformations:transformations
metadata:nil
configuration:configuration
outputPixelSpecificationRequirement:nil];
NSError *error;
FSPSpectrum *spectrum = [[FSPSpectrum alloc] initWithPlugins:@[[FSPJpegPlugin new]]
configuration:nil];
FSPResultData *result = [spectrum encodeImage:image options:options error:&error];
return result.data;
}
The text was updated successfully, but these errors were encountered: