-
Notifications
You must be signed in to change notification settings - Fork 239
Description
Experiencing a weird issue where randomly resize takes very long time. In the most recent occurrence it took around 30 mins. One additional thing I have observed is that if imgscalr seems to be stuck, logging into the machine causes the issue to resolve.
I have changed macOS Settings but to no avail. Here are relevant settings:
Screen Saver -> Starts After: Never
Energy Saver -> Turn Display Off: Never
Energy Saver -> Prevent Computer from Sleeping when display is off: Checked
Energy Saver -> (remaining settings are unchecked)
The code that invokes resize is as follows:
public static BufferedImage resizeImage(BufferedImage image, Integer width, Integer height) throws Exception {
LGR.info("Resizing image to :: " + width + " x " + height);
BufferedImage scaled = Scalr.resize(image, Scalr.Method.AUTOMATIC, width, height);
LGR.info("Done Resizing");
return scaled;
}
Logs from the above code:
2018-09-26 01:21:08 [pool-2-thread-1] [INFO ] [ScreenShotUtils ] [222] - Resizing image to :: 375 x 667
[imgscalr] Debug output ENABLED
[imgscalr] Resizing Image [size=750x1334, resizeMode=AUTOMATIC, orientation=Portrait, ratio(H/W)=1.778667] to [targetSize=375x667]
[imgscalr] AUTOMATIC scaling method selected: QUALITY
[imgscalr] Using Scaling Method: QUALITY
[imgscalr] QUALITY scale-down, incremental scaling will be used...
[imgscalr] Scaling from [750 x 1334] to [375 x 667]
....
....
....
2018-09-26 01:54:20 [pool-5-thread-1] [INFO ] [xxxxxxx] [47] - <A lot of logs from other thread in between, so process is definitely still running>
....
....
[imgscalr] Incrementally Scaled Image in 1 steps.
[imgscalr] Resized Image in 2000611 ms
2018-09-26 01:54:29 [pool-2-thread-1] [INFO ] [ScreenShotUtils ] [224] - Done Resizing
Environment:
Machine: Mac mini (Late 2014)
OS: macOS 10.13.6
Processor: 2.8 GHz Intel Core i5
Memory: 16 GB 1600 MHz DDR3
Graphics: Intel Iris 1536 MB
Java Version:
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
imgscalr(included through mvn):
<dependency>
<groupId>org.imgscalr</groupId>
<artifactId>imgscalr-lib</artifactId>
<version>4.2</version>
</dependency>