Skip to content
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

generate_image_file: don't hardcode the file format #6538

Merged
merged 1 commit into from
Jul 23, 2023

Conversation

SpecLad
Copy link
Contributor

@SpecLad SpecLad commented Jul 21, 2023

Motivation and context

It doesn't make much sense to encode the image as JPEG if the given file name is "image.png". Instead, let PIL select the format based on the requested file name.

This was originally a part of #6483, but it's not directly related to the topic of that PR, so I decided to submit it separately.

How has this been tested?

Unit tests.

Checklist

  • I submit my changes into the develop branch
  • [ ] I have added a description of my changes into the CHANGELOG file
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)
  • [ ] I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

It doesn't make much sense to encode the image as JPEG if the given file
name is "image.png". Instead, let PIL select the format based on the
requested file name.
@SpecLad SpecLad requested a review from zhiltsov-max July 21, 2023 16:40
@SpecLad SpecLad requested a review from azhavoro as a code owner July 21, 2023 16:40
@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Merging #6538 (309344f) into develop (c230395) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop    #6538      +/-   ##
===========================================
+ Coverage    81.71%   81.75%   +0.04%     
===========================================
  Files          337      337              
  Lines        38512    38525      +13     
  Branches      3545     3547       +2     
===========================================
+ Hits         31470    31497      +27     
+ Misses        7042     7028      -14     
Components Coverage Δ
cvat-ui 75.22% <ø> (+0.09%) ⬆️
cvat-server 87.81% <100.00%> (-0.01%) ⬇️

@SpecLad SpecLad merged commit 1bc7767 into cvat-ai:develop Jul 23, 2023
@SpecLad SpecLad deleted the generate-image-file-format branch July 23, 2023 19:59
mikhail-treskin pushed a commit to retailnext/cvat that referenced this pull request Oct 25, 2023
It doesn't make much sense to encode the image as JPEG if the given file
name is "image.png". Instead, let PIL select the format based on the
requested file name.
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