Skip to content

[ui] Replace Qt image I/O and scaling with pyalicevision in thumbnail creation#3067

Draft
Copilot wants to merge 2 commits intodevelopfrom
copilot/replace-qimage-reader-writer
Draft

[ui] Replace Qt image I/O and scaling with pyalicevision in thumbnail creation#3067
Copilot wants to merge 2 commits intodevelopfrom
copilot/replace-qimage-reader-writer

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

Description

Replaces all Qt image handling (QImageReader, QImageWriter, QImage.scaled) in thumbnail creation with pyalicevision.image (OpenImageIO backend), giving access to RAW, EXR, HDR and other formats Qt cannot decode.

Features list

  • Read images via avImage.readImage with EImageColorSpace_SRGB
  • Downscale via avImage.resizeImage(newW, newH, image, thumbnail) — aspect ratio computed in Python
  • Write thumbnails via avImage.writeImage with EImageColorSpace_NO_CONVERSION
  • Remove QImageReader, QImageWriter, QImage, Qt, numpy imports — thumbnail pipeline is now Qt-free for image data

Implementation remarks

The full pipeline in createThumbnail:

  1. ReadavImage.readImage(path, Image_RGBColor(), ImageReadOptions(EImageColorSpace_SRGB))
  2. Scale — aspect-ratio-preserving target size computed with scale = min(maxW/w, maxH/h), then avImage.resizeImage(newW, newH, image, thumbnail) (OpenImageIO high-quality resampling)
  3. WriteavImage.writeImage(path, thumbnail, ImageWriteOptions(), oiioParams().get()) with EImageColorSpace_NO_CONVERSION (data already sRGB)

The zero-dimension guard uses cached w, h variables retrieved before the check, avoiding redundant calls and making division-by-zero impossible.

Copilot AI and others added 2 commits April 1, 2026 21:06
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

Successfully merging this pull request may close these issues.

2 participants