Summary: | Using custom scanning program to create a TIFF file scan caused kioworker to crash | ||
---|---|---|---|
Product: | [Frameworks and Libraries] kio-extras | Reporter: | totte <hans.tovetjarn> |
Component: | Thumbnails and previews | Assignee: | Plasma Bugs List <plasma-bugs-null> |
Status: | REPORTED --- | ||
Severity: | crash | CC: | nate |
Priority: | NOR | Keywords: | drkonqi |
Version First Reported In: | 24.08.2 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
totte
2024-10-31 11:41:26 UTC
What scanning app were you using? (In reply to Nate Graham from comment #1) > What scanning app were you using? I haven't been able to reproduce this. I've been running `scanimage` like so: ``` #! /usr/bin/env python3 import os import subprocess import sys from PIL import Image # TODO: Check CLI args, default to not rotating orientation = None if len(sys.argv) > 1: orientation = int(sys.argv[1]) save_path = "/home/totte/Pictures/Scans/" counter = 1 filename_prefix = "{:02d}" filename_suffix = ".tiff" filename = filename_prefix + filename_suffix while os.path.isfile(os.path.join(save_path, filename.format(counter))): counter += 1 filename = filename.format(counter) complete_path = os.path.join(save_path, filename) # TODO: Replace with https://github.com/python-pillow/Sane subprocess.run( [ "scanimage", "--format=tiff", "--output-file", complete_path, "--progress", "--mode", "Gray", "--resolution", "600", "-x", "206", "-y", "292", ] ) index = complete_path.find(".tiff") jpg_complete_path = complete_path[:index] + ".jpg" png_complete_path = complete_path[:index] + ".png" scannedImage = Image.open(complete_path) if orientation is not None: rotatedImage = scannedImage.rotate(orientation, expand=1) rotatedImage.save(complete_path) resizedImage = rotatedImage.resize((1920, 1354), 1) else: resizedImage = scannedImage.resize((1354, 1920), 1) resizedImage.save(png_complete_path, optimize=True) ``` Dolphin and Krita run all the time, if that could somehow be related to this. I scan pencil sketches before and after inking them, and try to automate the workflow using Python. I keep the original TIFFs and create smaller PNGs for sharing. The file system is `btrfs`. So to be clear: you wrote a custom scanning program, and when you use it, it caused the kioworker process to crash? It seems possible that the file is being altered progressively while thumbnail generation is in progress, triggering a code bug that makes it crash. We should fix the crahs, but I'd also suggest fixing your program to save atomically. (In reply to Nate Graham from comment #3) > So to be clear: you wrote a custom scanning program, and when you use it, it > caused the kioworker process to crash? Yes, and yes (that one time). I've run the script at least 26 times since my previous comment, and it hasn't happened again. > It seems possible that the file is being altered progressively while > thumbnail generation is in progress, triggering a code bug that makes it > crash. We should fix the crahs, but I'd also suggest fixing your program to > save atomically. Thank you for the advice – I'll do that. |