@@ -149,6 +149,7 @@ Clip::Clip(ReaderBase* new_reader) : resampler(NULL), reader(new_reader), alloca
149
149
if (reader) {
150
150
End (reader->info .duration );
151
151
reader->ParentClip (this );
152
+ reader_type = reader->Name ();
152
153
// Init reader info struct
153
154
init_reader_settings ();
154
155
}
@@ -208,6 +209,7 @@ Clip::Clip(std::string path) : resampler(NULL), reader(NULL), allocated_reader(N
208
209
if (reader) {
209
210
End (reader->info .duration );
210
211
reader->ParentClip (this );
212
+ reader_type = reader->Name ();
211
213
allocated_reader = reader;
212
214
// Init reader info struct
213
215
init_reader_settings ();
@@ -482,6 +484,15 @@ void Clip::reverse_buffer(juce::AudioBuffer<float>* buffer)
482
484
reversed = nullptr ;
483
485
}
484
486
487
+ bool Clip::shouldScale () const
488
+ {
489
+ if (scale == SCALE_NONE && (reader_type == " QtImageReader" || reader_type == " FFmpegReader" )) {
490
+ return false ;
491
+ }
492
+
493
+ return true ;
494
+ }
495
+
485
496
// Adjust the audio and image of a time mapped frame
486
497
void Clip::get_time_mapped_frame (std::shared_ptr<Frame> frame, int64_t frame_number)
487
498
{
@@ -1461,7 +1472,7 @@ QTransform Clip::get_transform(std::shared_ptr<Frame> frame, int width, int heig
1461
1472
1462
1473
float scaled_source_width = source_size.width ();
1463
1474
float scaled_source_height = source_size.height ();
1464
- if (scale != SCALE_NONE ) {
1475
+ if (shouldScale () ) {
1465
1476
scaled_source_width *= sx;
1466
1477
scaled_source_height *= sy;
1467
1478
}
@@ -1532,7 +1543,7 @@ QTransform Clip::get_transform(std::shared_ptr<Frame> frame, int width, int heig
1532
1543
transform.translate (-origin_x_offset,-origin_y_offset);
1533
1544
}
1534
1545
// SCALE CLIP (if needed)
1535
- if (scale != SCALE_NONE ) {
1546
+ if (shouldScale () ) {
1536
1547
float source_width_scale = (float (source_size.width ()) / float (source_image->width ())) * sx;
1537
1548
float source_height_scale = (float (source_size.height ()) / float (source_image->height ())) * sy;
1538
1549
if (!isEqual (source_width_scale, 1.0 ) || !isEqual (source_height_scale, 1.0 )) {
0 commit comments