Is skanpage now broken?

Hi,
looking for confirmation or, on the contrary the indication that the problem is exclusively with my host.

Has skanpage recently been broken. In the preview, I am now unable to use the handles to select the scan area.

Thanks,
Sergio

There were a couple of changes to skanpage in the v26.08.0 release of KDE Gear last month:

That is the version Stable & Testing branches are currently on. There haven’t been any further changes in v26.08.1 of KDE Gear, which Unstable branch is on.

You could also browse the Skanepage Git repo to see if there are recent changes which stand out:

I also used forum-scout-qt to do searches for skanlite & skanlite preview on other Arch-based distro forums, as well as KDE Discuss, and there was nothing of note in the results.

Diagnosed.

The issue is a regression in kquickimageeditor. Downgrading it to version 0.6.2.1 restores correct behaviour. The 0.7.x series is broken.

Issue reported upstream at https://invent.kde.org/libraries/kquickimageeditor/-/work_items/9.

Please, consider reverting to 0.6.2.1 for Manjaro stable until a current version of kquickimageeditor carries a fix.


Found a previous, better upstream bug report to follow:

Mod edit: Merged consecutive posts.

Given the state of Printer software for Linux, I went with a function for my scanning… and I have picked up and scanned a couple of books and settled on the following workflow bringing the keyboard down to the printer so I can sit in comfort. Important as most of my ‘scanning’ involves books borrowed overnight, so I have to get them all done quickly.

I have a couple of functions (scana, scanb.. depending on what I need. For colour I might want a slight boost to give accurate colours on copy paper, and especially with higher resolution scans, I want to set the size of the crop manually after a quick 100dpi scan, selecting the crop in Gwenview, entering the pixel values to get an accurate sizing.

# Defined in /home/ben/.config/fish/functions/scanb.fish @ line 1
function scanb
    set -l valid_res 100 150 200 300 400 600 1200 2400
    
    # Resolution loop
    set -l r ""
    if test (count $argv) -ge 1
        set r $argv[1]
    end
    while true
        if test -z "$r"
            read -P "Resolution (enter for 300): " ri
            if test -z "$ri"; set r 300; else set r $ri; end
        end
        if contains $r $valid_res
            break
        else
            printf "Invalid. Available: 100,150,200,300,400,600,1200,2400\n"
            set r ""
        end
    end
    
    # Load last dims
    set -l lw ""; set -l lwu ""; set -l lh ""; set -l lhu ""
    if test -f ~/.scanb_last
        set -l L (cat ~/.scanb_last | string split \n)
        if test (count $L) -ge 2
            set -l wp (string split ' ' $L[1]); set lw $wp[1]; set lwu $wp[2]
            set -l hp (string split ' ' $L[2]); set lh $hp[1]; set lhu $hp[2]
        end
    end
    
    set -l dims 0; set -l wv ""; set -l wu ""; set -l hv ""; set -l hu ""; set -l full 0; set -l crop 0
    set -l skip_all 0
    
    # Width Prompt
    if test -n "$lw"; printf "Last w: %s%s\n" $lw $lwu; end
    read -P "W ([Enter] Scan [N]ext [F]ull, #=px, #mm=mm): " wi
    
    if test -z "$wi"
        if test -n "$lw" -a -n "$lh"
            set wv $lw; set wu $lwu
            set hv $lh; set hu $lhu
            set dims 1
        else
            set full 1
        end
        set skip_all 1
    else if test "$wi" = "n" -o "$wi" = "N"
        if test -n "$lw"; set wv $lw; set wu $lwu; end
    else if test "$wi" = "f" -o "$wi" = "F"
        set full 1
        set skip_all 1
    else
        if string match -r 'mm$' -- $wi > /dev/null
            set wv (string replace -r 'mm$' '' -- $wi | string trim); set wu "mm"
        else
            set wv (string trim -- $wi); set wu "px"
        end
        if not string match -r '^[0-9]*\.?[0-9]+$' -- $wv > /dev/null; printf "Invalid\n"; return 1; end
    end
    
    # Height Prompt
    if test $skip_all -eq 0
        if test -n "$lh"; printf "Last h: %s%s\n" $lh $lhu; end
        read -P "H ([Enter] Scan [N]ext [F]ull, #=px, #mm=mm): " hi
        
        if test -z "$hi"
            if test -n "$wv" -a -z "$hv" -a -n "$lh"
                set hv $lh; set hu $lhu
            end
        else if test "$hi" = "n" -o "$hi" = "N"
            if test -n "$lh" -a -z "$hv"; set hv $lh; set hu $lhu; end
        else if test "$hi" = "f" -o "$hi" = "F"
            set full 1
        else
            if string match -r 'mm$' -- $hi > /dev/null
                set hv (string replace -r 'mm$' '' -- $hi | string trim); set hu "mm"
            else
                set hv (string trim -- $hi); set hu "px"
            end
            if not string match -r '^[0-9]*\.?[0-9]+$' -- $hv > /dev/null; printf "Invalid\n"; return 1; end
        end
    end
    
    # Final dimension validation
    if test -n "$wv" -a -n "$hv" -a $full -eq 0
        set dims 1
    else if test $full -eq 0
        set full 1
    end
    
    if test $full -eq 1
        set wv ""; set wu ""; set hv ""; set hu ""; set dims 0
        read -P "Auto-crop? [y/N]: " cc
        if test "$cc" = "y" -o "$cc" = "Y"; set crop 1; end
    end
    
    # Base name
    set -l base "s"
    if test (count $argv) -ge 2; set base $argv[2]
    else if test $dims -eq 1; set base "sc"
    end
    
    # Standardize values to mm for scanner execution
    set -l wm 0; set -l hm 0
    if test $dims -eq 1
        if test "$wu" = "px"
            set wm (printf "%.2f" (printf "scale=4; %s * 25.4 / 100\n" $wv | bc -l))
        else
            set wm $wv
        end
        
        if test "$hu" = "px"
            set hm (printf "%.2f" (printf "scale=4; %s * 25.4 / 100\n" $hv | bc -l))
        else
            set hm $hv
        end
    end
    
    # Index from existing files
    set -l pat "$base"_"$r"_*.png
    set -l max 0
    for f in $pat
        set -l base_no_ext (string replace -r '\.png$' '' $f)
        set -l parts (string split '_' $base_no_ext)
        set -l num $parts[-1]
        if test -n "$num" -a (string match -r '^[0-9]+$' $num) -a $num -gt $max
            set max $num
        end
    end
    set -l idx (math $max + 1)
    
    # Filename
    set -l fname
    if test $dims -eq 1
        set -l dw (printf "%.0f" $wm)
        set -l dh (printf "%.0f" $hm)
        set fname "$base"_"$r"_"["$dw"mm×"$dh"mm]"_"$idx".png
    else
        set fname "$base"_"$r"_"$idx".png
    end
    printf "Output: %s\n" $fname
    
    # Build scan command
    set -l cmd scanimage --format=png --resolution $r -o $fname
    if test $dims -eq 1
        printf "Area: %.2f×%.2f mm\n" $wm $hm
        set cmd $cmd -l 0 -t 0 -x $wm -y $hm
    else if test $full -eq 1 -a $crop -eq 1
        set cmd $cmd --AutoDocumentSize=yes
        printf "Auto-crop enabled\n"
    else
        printf "Full bed scan\n"
    end
    
    printf "Scanning...\n"
    if not $cmd
        printf "Scan failed.\n"
        return 1
    end
    
    # Save last dims (store normalized mm)
    if test $dims -eq 1
        echo "$wm mm" > ~/.scanb_last
        echo "$hm mm" >> ~/.scanb_last
    end
    
    printf "Saved to %s\n" $fname
end

I guess I should take another look at the GUI front ends, but to be honest - I’m not sure when (or if) I’ll get a Round Tuit… but this is good, I get enough time to pull out the book, turn it over and hit Enter twice to scan again at the same dimension/resolution/quality… however, it’s not creating a PDF. Oh, obviously I get to type in the first part of the filename, so they’re easily sorted.

Default is 300dpi (the ‘reasonable’ resolution for printing imagery before the time taken to complete the scan becomes ridiculous - though I did a couple of 2400 dpi scans just to see how much better they were than 1200 (turns out it brings out some extra clarity when scanning your local currency in the finer details).

Takes a little working out, from whatever driver your printer uses, but worth the squeeze :wink:

Always used Brother hardware, they are updating their drive fairly regularly. Everything worked as expected for the last decade or so.

Well strangely that’s exactly what I bought - but there are severe limitations on the drivers they supply for Linux - it’s pretty basic.

You can have a lot of fun trying to print a landscape page and not have it print off the sides of an A4 in portrait (ignoring your preview) until you get used to its quirks.

But like the HP I had before, command line lets you explore and pick out exactly what functions you need - for scanning, terminal is superb and lets me sit with the printer where I stashed my ancient K400 (wireless logitech) so that I can just hit "↑ ⏎ Enter once my page is ready to scan.

So the issue is most likely in Qt itself and causes kquickimageeditor to behave strangely. You can work around the problem by re-building the kquickimageeditor package with the QML compiler disabled.

You can take the arch source for the package and modify the PKGBUILD by changing the prepare() function into:

prepare() {
  cd "$srcdir/$pkgbase-$pkgver"

  sed -i -e 's|OpenCV 4.7|OpenCV 5|' CMakeLists.txt

  cat >> src/CMakeLists.txt <<'EOF'

# Work around broken native QML code; retain precompiled bytecode.
set_property(TARGET KQuickImageEditor APPEND PROPERTY
    QT_QMLCACHEGEN_ARGUMENTS --only-bytecode
)
EOF
}