You are not logged in.

#1 2025-12-02 11:34:03

002445
Member
Registered: 2021-10-07
Posts: 29

import command from the imagemagick application generates broken files

Hi everyone,

I am using the

import

command from the imagemagick application in a script 'blurlock' to create a lockscreen. After updating imagemagick to the latest version (7.1.2.9-1) the generated image used for the lockscreen is broken, broken as in the file won't open in any image viewer. Using the previous version of imagemagick (7.1.2.8-1) works fine.

The blurlock script contains the following:

#!/bin/bash
set -eu

RESOLUTION=$(xrandr -q|sed -n 's/.*current[ ]\([0-9]*\) x \([0-9]*\),.*/\1x\2/p')

# lock the screen
import -silent -window root jpeg:- | magick - -scale 20% -blur 0x2.5 -resize 500% RGB:- | \
    i3lock --raw $RESOLUTION:rgb -i /dev/stdin -e -u $@
    
# sleep 1 adds a small delay to prevent possible race conditions with suspend
#sleep 1

exit 0

It should generate a screenshot, blur the image and set it as the lockscreen. I think the issue is in this part:

import -silent -window root jpeg:-

If I run a command like the following that should save the screenshot to my homefolder on both the current and previous versions. But I get a broken image on the new version and a working image on the previous version.

import -silent -window root jpeg:$HOME/test123.jpg

Other people notice this issue as well? What happens if you guys run the last command on version 7.1.2.9-1, do you get a broken image as well or do you get a working jpg with a screenshot?

Thank you in advance.

Last edited by 002445 (2025-12-02 12:13:02)

Offline

#2 2025-12-02 12:08:51

256
Member
Registered: 2023-12-17
Posts: 57

Re: import command from the imagemagick application generates broken files

Can confirm; your command works properly in 7.1.2.8-1 but not 7.1.2.9-1.  It seems I can still successfully convert PNG files to JPEG with the "magick" command, though. Checking their GitHub, this problem seems to have already been reported (by another Arch user, interestingly).


"Don't comment bad code - rewrite it." - The Elements of Programming Style (1978), Brian W. Kernighan & P. J. Plauger, p. 144.

Offline

Board footer

Powered by FluxBB