Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
d67fcf28
Commit
d67fcf28
authored
Feb 26, 2021
by
Jean-Baptiste Mardelle
Browse files
Don't enforce profile width multiple of 8.
Related to
#954
parent
167aadd3
Pipeline
#52358
canceled with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/core.cpp
View file @
d67fcf28
...
...
@@ -416,7 +416,7 @@ bool Core::setCurrentProfile(const QString &profilePath)
void
Core
::
checkProfileValidity
()
{
int
offset
=
(
getCurrentProfile
()
->
profile
().
width
()
%
8
)
+
(
getCurrentProfile
()
->
profile
().
height
()
%
2
);
int
offset
=
(
getCurrentProfile
()
->
profile
().
width
()
%
2
)
+
(
getCurrentProfile
()
->
profile
().
height
()
%
2
);
if
(
offset
>
0
)
{
// Profile is broken, warn user
if
(
m_binWidget
)
{
...
...
src/doc/kdenlivedoc.cpp
View file @
d67fcf28
...
...
@@ -1439,7 +1439,7 @@ void KdenliveDoc::switchProfile(std::unique_ptr<ProfileParam> &profile, const QS
}
}
QString
matchingProfile
=
ProfileRepository
::
get
()
->
findMatchingProfile
(
profile
.
get
());
if
(
matchingProfile
.
isEmpty
()
&&
(
profile
->
width
()
%
8
!=
0
))
{
if
(
matchingProfile
.
isEmpty
()
&&
(
profile
->
width
()
%
2
!=
0
))
{
// Make sure profile width is a multiple of 8, required by some parts of mlt
profile
->
adjustDimensions
();
matchingProfile
=
ProfileRepository
::
get
()
->
findMatchingProfile
(
profile
.
get
());
...
...
src/jobs/loadjob.cpp
View file @
d67fcf28
...
...
@@ -166,8 +166,8 @@ void LoadJob::checkProfile(const QString &clipId, const QDomElement &xml, const
if
(
service
==
QLatin1String
(
"qimage"
)
||
service
==
QLatin1String
(
"pixbuf"
))
{
// This is an image, create profile from image size
int
width
=
producer
->
get_int
(
"meta.media.width"
);
if
(
width
%
8
>
0
)
{
width
+=
8
-
width
%
8
;
if
(
width
%
2
>
0
)
{
width
+=
width
%
2
;
}
int
height
=
producer
->
get_int
(
"meta.media.height"
);
height
+=
height
%
2
;
...
...
src/profiles/profilemodel.cpp
View file @
d67fcf28
...
...
@@ -157,13 +157,11 @@ ProfileParam::ProfileParam(QDomElement element)
// Ensure profile has viable width / height
int
width
=
element
.
attribute
(
QStringLiteral
(
"width"
)).
toInt
();
int
height
=
element
.
attribute
(
QStringLiteral
(
"height"
)).
toInt
();
if
((
width
%
8
)
+
(
height
%
2
)
>
0
)
{
if
((
width
%
2
)
+
(
height
%
2
)
>
0
)
{
pCore
->
displayBinMessage
(
i18n
(
"The project profile is invalid (%1x%2), it was adjusted to %3x%4."
,
width
,
height
,
width
+
(
width
%
8
),
height
+
(
height
%
2
)),
i18n
(
"The project profile is invalid (%1x%2), it was adjusted to %3x%4."
,
width
,
height
,
width
+
(
width
%
2
),
height
+
(
height
%
2
)),
KMessageWidget
::
Warning
);
if
(
width
%
8
>
0
)
{
width
+=
8
-
width
%
8
;
}
width
+=
width
%
2
;
height
+=
height
%
2
;
element
.
setAttribute
(
QStringLiteral
(
"width"
),
width
);
element
.
setAttribute
(
QStringLiteral
(
"height"
),
height
);
...
...
@@ -271,8 +269,8 @@ double ProfileParam::sar() const
}
void
ProfileParam
::
adjustDimensions
()
{
if
(
m_width
%
8
>
0
)
{
m_width
+=
8
-
m_width
%
8
;
if
(
m_width
%
2
>
0
)
{
m_width
+=
m_width
%
2
;
}
m_height
+=
m_height
%
2
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment