Skip to content

Conversation

Songmu
Copy link
Collaborator

@Songmu Songmu commented Jul 27, 2025

In code blocks, the aspect ratio and size are undefined, and it is important to display the entire image generated, so I would like to modify the image replacement method.

Copy link
Contributor

Code Metrics Report

main (ece224a) #317 (93bbb5e) +/-
Coverage 33.3% 33.3% +0.0%
Code to Test Ratio 1:0.9 1:0.9 -0.1
Test Execution Time 10s 12s +2s
Details
  |                     | main (ece224a) | #317 (93bbb5e) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          33.3% |          33.3% | +0.0% |
  |   Files             |             23 |             23 |     0 |
  |   Lines             |           2777 |           2783 |    +6 |
+ |   Covered           |            925 |            927 |    +2 |
- | Code to Test Ratio  |          1:0.9 |          1:0.9 |  -0.1 |
  |   Code              |           5603 |           5618 |   +15 |
  |   Test              |           5072 |           5072 |     0 |
- | Test Execution Time |            10s |            12s |   +2s |

Code coverage of files in pull request scope (49.7% → 49.6%)

Files Coverage +/- Status
action.go 80.9% +0.1% modified
apply.go 1.3% -0.1% modified
md/md.go 62.6% 0.0% modified
slide.go 66.3% -0.4% modified

Reported by octocov

Copy link
Owner

@k1LoW k1LoW left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!!

Comment on lines +476 to +481
imageReplaceMethod := "CENTER_CROP"
if info.codeBlock {
// In the case of code blocks, it is important that the entire image can be seen
// without being cropped, so switch the replace method.
imageReplaceMethod = "CENTER_INSIDE"
}
Copy link
Owner

Choose a reason for hiding this comment

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

I like the idea of changing the REPLACE METHOD only for the code block.

I think it is a practical solution.

@k1LoW k1LoW added enhancement New feature or request minor labels Jul 27, 2025
@k1LoW k1LoW merged commit 1c742fa into main Jul 27, 2025
1 check passed
@k1LoW k1LoW deleted the update-crop branch July 27, 2025 23:06
@github-actions github-actions bot mentioned this pull request Jul 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants