Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resize randomly gets stuck for very long time #131

Open
tahasamad opened this issue Sep 26, 2018 · 1 comment
Open

Resize randomly gets stuck for very long time #131

tahasamad opened this issue Sep 26, 2018 · 1 comment

Comments

@tahasamad
Copy link

tahasamad commented Sep 26, 2018

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>
@mleonhard
Copy link

I think MacOS is entering a power-save mode and pausing the app. Try using the MacOS Console application to check for messages about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants