Skip to content

Conversation

SmilyOrg
Copy link
Owner

Improved thumbnail generation, adding djpeg support and fixed image orientation handling.

Image Processing Enhancements:

  • Added support for handling image orientation during thumbnail generation, including rotation and mirroring based on metadata. (internal/image/indexContents.go, io/sqlite/sqlite.go, io/io.go) [1] [2] [3]
  • Introduced a two-pass approach for optimized image resizing in the Djpeg utility, with dynamic scaling based on target dimensions. (io/djpeg/djpeg.go) [1] [2]
  • Added GetWithSize method to allow fetching images with specific dimensions, implemented in several image sources (io/configured/configured.go, io/filtered/filtered.go, io/djpeg/djpeg.go). [1] [2] [3]

Dependency Updates:

  • Updated go.mod to use Go 1.23.0 and added support for newer versions of dependencies like golang.org/x/image and golang.org/x/sync. Removed deprecated dependencies (github.com/jbuchbinder/gopnm). (go.mod) [1] [2] [3] [4]
  • Replaced pnm decoding with bmp decoding in the Djpeg utility for better compatibility and performance. (io/djpeg/djpeg.go) [1] [2]

Task Configuration:

  • Added a new struct task to analyze struct layouts using the structlayout tool, improving developer tooling for debugging and optimization. (Taskfile.yml)

Thumbnail Generation Improvements:

  • Updated default thumbnail generators to use djpeg for libjpeg-turbo decoding and adjusted configurations for better handling of resized images. (defaults.yaml)
  • Enhanced FFmpeg thumbnail generation to include image orientation metadata. (io/ffmpeg/ffmpeg.go)

These changes collectively improve the functionality, maintainability, and performance of the codebase, particularly in image processing and development tooling.

SmilyOrg added 3 commits July 24, 2025 00:09
- Updated the djpeg package to use the netpbm library for decoding.
- Enhanced the resize function to avoid unnecessary resizing if the image is already smaller than the target dimensions.
- Introduced a two-pass approach in the Get method of the Djpeg struct to optimize image retrieval based on specified dimensions.
- Added a new function, getMinimalScale, to determine the optimal scale for resizing images.
- Improved the FFmpeg package to include orientation information in the result.
- Refactored the goimage package to include a similar resize optimization.
- Enhanced the io package to provide a SwapsDimensions method for orientation handling.
- Implemented image rotation logic in the sqlite package to handle various orientations based on EXIF data.
- Added comprehensive tests for image rotation and thumbnail generation, ensuring correct handling of orientations.
- Updated benchmark tests for thumbnail generation to improve performance metrics.
@SmilyOrg SmilyOrg marked this pull request as ready for review July 24, 2025 18:29
@SmilyOrg SmilyOrg changed the title Thumb gen improvements Thumbnail generation improvements Jul 24, 2025
@SmilyOrg SmilyOrg merged commit 54e7fdc into main Jul 24, 2025
1 check passed
@SmilyOrg SmilyOrg deleted the thumb-gen-improvements branch July 24, 2025 18:33
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.

1 participant