-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Treat svgz file as a vector image #22820
Conversation
b7dc97f
to
fd84b78
Compare
why not adding ".svg.gz" too? |
Probably because the suffix will then be considered to be |
Some code (from Mu3): void MIconEngine::addFile(const QString &fileName, const QSize &, QIcon::Mode mode, QIcon::State state)
{
if (!fileName.isEmpty()) {
QString abs = fileName;
if (fileName.at(0) != QLatin1Char(':'))
abs = QFileInfo(fileName).absoluteFilePath();
if (abs.endsWith(QLatin1String(".svg"), Qt::CaseInsensitive)
|| abs.endsWith(QLatin1String(".svgz"), Qt::CaseInsensitive)
|| abs.endsWith(QLatin1String(".svg.gz"), Qt::CaseInsensitive))
{
QSvgRenderer renderer(abs);
if (renderer.isValid()) {
d->stepSerialNum();
d->svgFiles.insert(d->hashKey(mode, state), abs);
}
} |
Initially I added support for P.S. |
Yes, I'm currently backporting this to Mu3. And found a few other places where we could/should support |
Backport of musescore#22820 Plus some include files cleanup
in Mu4 it is in MuseScore/src/notation/internal/notationactioncontroller.cpp Lines 1244 to 1245 in b38394f
,
and
|
30ad76f
to
55982fe
Compare
55982fe
to
5d679c6
Compare
Thank you, @Jojo-Schmitz! Added your changes. Everything seems to be working |
Tested on MacOS 14, Windows 11, Ubuntu 22.04.3. Approved |
Backport of musescore#22820 Plus some include files cleanup
Musescore suddenly supports compressed svg files (with
.svgz
extension) if you add them via drag&drop.This PR fixes a situation where compressed svgs are incorrectly treated as raster images, which causes incorrect "pixelated" rendering and makes musescore slow.
Before:
After:
Explanations:
A compressed svg file is a regular gzipped svg.
Musescore accepts and renders svg files in these formats:
.svg
extension (correct rendering).svg
extension (correct rendering).svgz
extension (incorrect raster rendering, fixed by this PR).svg.gz
extension (incorrect raster rendering, not covered by this PR)