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

Refactor out lossless JPEG code so that it can eventually be used independently #127

Merged
merged 15 commits into from
Dec 9, 2024

Conversation

mcroomp
Copy link
Collaborator

@mcroomp mcroomp commented Dec 4, 2024

The JPEG code is useful for writing and reading JPEG files without any loss of fidelity. This can be useful for other things, such as lossless rotation, 8:1 thumbnails etc.

As a first step, remove the dependences on Lepton code and put into own module.

@mcroomp mcroomp requested review from Copilot and Melirius December 4, 2024 21:38

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 12 out of 25 changed files in this pull request and generated no suggestions.

Files not reviewed (13)
  • package/Lepton.Jpeg.Rust.nuspec: Language not supported
  • src/structs/idct.rs: Evaluated as low risk
  • src/jpeg/mod.rs: Evaluated as low risk
  • src/jpeg/row_spec.rs: Evaluated as low risk
  • src/structs/lepton_encoder.rs: Evaluated as low risk
  • src/structs/lepton_decoder.rs: Evaluated as low risk
  • src/structs/block_context.rs: Evaluated as low risk
  • src/jpeg/jpeg_position_state.rs: Evaluated as low risk
  • src/jpeg/block_based_image.rs: Evaluated as low risk
  • src/jpeg/jpeg_write.rs: Evaluated as low risk
  • src/structs/lepton_file_reader.rs: Evaluated as low risk
  • src/jpeg/truncate_components.rs: Evaluated as low risk
  • src/jpeg/bit_writer.rs: Evaluated as low risk
Comments skipped due to low confidence (2)

src/jpeg/jpeg_header.rs:48

  • [nitpick] The error message 'invalid header encountered' is unclear. Suggest changing it to 'Invalid JPEG header encountered: expected 0xFF but found {header[0]}'.
return err_exit_code(ExitCode::UnsupportedJpeg, "invalid header encountered");

src/jpeg/jpeg_header.rs:61

  • [nitpick] The error message 'segment is too short' is unclear. Suggest changing it to 'JPEG segment size is too short: expected at least 2 bytes but found {segment_size}'.
return err_exit_code(ExitCode::UnsupportedJpeg, "segment is too short");
@Melirius
Copy link
Collaborator

Melirius commented Dec 5, 2024

Nice work! But large, so it'll take some time to review.

Copy link
Collaborator

@Melirius Melirius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally have checked. Nice work.

@mcroomp mcroomp merged commit caeea98 into main Dec 9, 2024
3 checks passed
@mcroomp mcroomp deleted the jpegrefactor branch December 9, 2024 02:52
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