Skip to content

Commit b69844c

Browse files
committed
fix: review comments
1 parent 3f43524 commit b69844c

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

package/ios/ImageManager.m

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ @implementation ImageManager: NSObject
66
+ (UIImage *)scaleImage:(UIImage *)image
77
size:(CGSize)size
88
{
9-
if (!image || image.size.width <= 0 || image.size.height <= 0 || size.width <= 0 || size.height <= 0) {
10-
return nil;
11-
}
12-
139
CGFloat scale = MAX(size.width/image.size.width, size.height/image.size.height);
1410
CGFloat width = image.size.width * scale;
1511
CGFloat height = image.size.height * scale;
@@ -29,10 +25,6 @@ + (UIImage *)scaleImage:(UIImage *)image
2925
+ (CGSize)getImageCGSize:(UIImage *)imageData
3026
width:(int)width
3127
{
32-
if (!imageData || imageData.size.width <= 0 || imageData.size.height <= 0 || width <= 0) {
33-
return CGSizeZero;
34-
}
35-
3628
NSInteger imgHeight = imageData.size.height;
3729
NSInteger imagWidth = imageData.size.width;
3830

package/ios/ThePrinter.m

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -393,16 +393,7 @@ -(int) addImage: (NSDictionary *)source
393393
}
394394

395395
CGSize size = [ImageManager getImageCGSize:data width:width];
396-
// Check if size calculation failed (e.g., invalid image dimensions)
397-
if (size.width <= 0 || size.height <= 0) {
398-
return EPOS2_ERR_PARAM;
399-
}
400-
401396
UIImage *scaledImage = [ImageManager scaleImage:data size:size];
402-
// Check if image scaling failed
403-
if (scaledImage == nil) {
404-
return EPOS2_ERR_PARAM;
405-
}
406397

407398
int result = [epos2Printer_ addImage: scaledImage x:0 y:0 width:size.width height:size.height color:color mode:mode halftone:halftone brightness:brightness compress:compress];
408399
return result;

0 commit comments

Comments
 (0)