File tree Expand file tree Collapse file tree 2 files changed +0
-17
lines changed
Expand file tree Collapse file tree 2 files changed +0
-17
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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;
You can’t perform that action at this time.
0 commit comments