Discovered a bug regarding image size scaling and rotation
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- c
- Domain
- computer-graphics
Research direction
Reproduce the example using the affine filter with distort and fill, then apply fix_rotate_x through the transition settings shown. Trace how transition.rect, non-proportional scaling, and rotation are handled, and compare the output at 90 and 45 degrees. Done means rotated output preserves the intended aspect ratio without distortion after non-proportional scaling.
Written by the indexing model from the issue text.
Description
Hello everyone, there is a strange bug here. When I non proportionally scale the original image size, for example, using the 'affine' filter to set the image size to 640x640, using both the 'distort' and 'fill' parameters, and then I use 'fix_rotate_x' to rotate the image 90 degrees , and you will find that the image has distortion, the aspect ratio of the rotated image has also changed,which is completely different from before the rotation I found that this problem also occurs when rotating at other angles.
However, I found that if I scale the original image proportionally, such as using the 'affine' filter's rect parameter to set the image size to 960x540 for a 1920x1080 resolution original image, and then rotate it 90 degrees, I did not find any abnormalities, and the image looked fine.
May I ask how to solve this problem? I want to achieve non proportional scaling of the image and then rotate it.
Here are some examples and detailed information
This is the original image
I scaled the original image in a non proportional manner to obtain this image
I rotated the scaled image 90 degrees clockwise and the resulting image is as follows. I can see that the aspect ratio of the image has changed, which is different from before the rotation
Similarly, when I rotate the scaled image clockwise by 45 degrees, the resulting image is as follows. It can be observed that the aspect ratio of the image has changed, which is different from before rotation, and there may also be distortion
However, when I proportionally scaled the original image and then rotated it, these issues did not occur
This is the original image
I scaled the original image in a proportional manner to obtain this image
I rotated the scaled image 90 degrees clockwise and the resulting image is as follows,this doesn't seem like a problem, the aspect ratio of the image before and after rotation is consistent
Similarly, when I rotate it 45 degrees, the image looks fine
This is how I use code:
filter->set("transition.distort", 1);
filter->set("transition.fill", 1);
char tmp[128];
snprintf(tmp, 128, "%g/%g:%gx%g:1", geometry.left(), geometry.top(), geometry.width(), geometry.height());
filter->set("transition.rect", tmp);
filter->set("transition.valign", "middle");
filter->set("transition.halign", "center");
filter->set("transition.fix_rotate_x", geometry.rotate());
producer->attach(*filter);
- Dominant language
- C
- Stars
- 1.9k
- Forks
- 391
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 12
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mltframework/mlt
-
Crash: avformat segfaults when reopening a file failsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mltframework/mlt#1335 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
mltframework/mlt#1333 ·
Maintainers usually reply within 1 day
-
_unique_id is assigned with a non-atomic increment, so concurrent services can share an idPossibly taken @unicorntearsproject claimed this 11 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 72/100
mltframework/mlt#1319 · 2 comments ·
Maintainers usually reply within 1 day
-
Crash: avformat decoder cache (size 4) evicts state another thread is still decoding withPossibly taken @unicorntearsproject claimed this 11 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 52/100
mltframework/mlt#1318 · 1 comment ·
Maintainers usually reply within 1 day
-
Crash: unguarded lazy init in loader, service cache and avformat when producers open on several threadsPossibly taken @unicorntearsproject claimed this 11 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 55/100
mltframework/mlt#1317 · 3 comments ·
Maintainers usually reply within 1 day
All issues in mltframework/mlt
Similar issues
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Add `pdfcpu` to the pantryPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
tmewett/BrogueCE#929 · 1 comment ·
Maintainers usually reply within 1 day
-
bug game: iwd2 system: GUI
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
category:port-update
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 2 days