-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed error for non-jpeg compressed images in original chunks #6789
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #6789 +/- ##
===========================================
- Coverage 82.46% 82.43% -0.03%
===========================================
Files 366 366
Lines 39836 39842 +6
Branches 3545 3545
===========================================
- Hits 32850 32843 -7
- Misses 6986 6999 +13
|
cvat/apps/engine/media_extractors.py
Outdated
# use loseless lzw compression for tiff images | ||
pil_image.save(output, format='TIFF', compression='tiff_lzw') | ||
else: | ||
pil_image.save(output, format=pil_image.format if pil_image.format else self.IMAGE_EXT, quality=95, subsampling=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why quality 95?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Values above 95 should be avoided; 100 disables portions of the JPEG compression algorithm, and results in large fileswith hardly any gain in image quality.
https://jdhao.github.io/2019/07/20/pil_jpeg_image_quality/
In my test file size with quality 100 was twice more than with quality 95.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not the original file in the case. Can we try to save in PNG format in the case and use the original name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I will return 100 quality.
There are some libraries which allow to rotate a jpeg file with 90 degrees step without loosing quality.
This is not only about jpeg images, exif is about different formats.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, let's wait linters and tests
### Added - Gamma correcton filter (<#6771>) - Introduced the feature to hide or show objects in review mode (<#6808>) ### Changed - \[Helm\] Database migrations are now executed as a separate job, rather than in the server pod, to mitigate the risk of data corruption when using multiple server replicas (<#6780>) - Clicking multiple times on icons in the left sidebar now toggles the corresponding popovers open and closed (<#6817>) - Transitioned to using KeyDB with FLASH for data chunk caching, replacing diskcache (<#6773>) ### Removed - Removed outdated use of hostnames when accessing Git, OpenCV, or analytics via the UI (<#6799>) - Removed the Feedback/Share component (<#6805>) ### Fixed - Resolved the issue of the canvas zooming while scrolling through the comments list in an issue (<#6758>) - Addressed the bug that allowed for multiple issue creations upon initial submission (<#6758>) - Fixed the issue of running deep learning models on non-JPEG compressed TIFF images (<#6789>) - Adjusted padding on the tasks, projects, and models pages (<#6778>) - Corrected hotkey handlers to avoid overriding default behavior when modal windows are open (<#6800>) - Resolved the need to move the mouse to activate brush or eraser effects; a single click is now sufficient (<#6800>) - Fixed a memory leak issue in the logging system (<#6804>) - Addressed a race condition that occurred during the initial creation of `secret_key.py` (<#6775>) - Eliminated duplicate log entries generated by the CVAT server (<#6766>)
Motivation and context
Resolved #6598
How has this been tested?
Checklist
develop
branch(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.