-
Notifications
You must be signed in to change notification settings - Fork 37
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
EXIF rotation is not reflected in Skia port #53
Comments
Yet I've not confirmed about the memory leaks, 5ca95c3 would improve the situation. The resulted PNG is looking like this:
I'm wondering how to fix these warning... |
@mpsuzuki I assume compiling of Skia worked. Could that be a difficulty with the svg-native-viewer project settings that are in conflict with the settings of Skia? |
Oh, I apologize making you confused. Yes, compiling Skia itself is successfully finished. But the inclusion of skcms.h causes the warning about the nameless structures in the union. It's just warning, and compiling itself finishes successfully. Maybe, giving some compiler flags (to compile SkiaSVGRenderer.cpp) would be able to calm it, but I'm wondering whether it's the way to go. Checking the latest source at skia.googlesource.com, still it uses nameless structure.
How do you think about this coding style? It should be permitted only for the external software (and SVG Native Viewer's own code should not permit this style)? |
@mpsuzuki Ultimately, fixing the issue in Skia and providing a PR for the Skia project seems to be the best approach. In the short term I we shouldn’t change or require changes in the Skia source code itself. If the above can be added to svg-native-viewer it is fine as well. But take the long term maintenance effort into account. The Skia source code is changing all the time and the above union might no longer work with newer Skia code if we add it to svg-native-viewer. Maybe ignoring the warning for Skia subdirectories might be the easiest and more long term approach after all. |
@dirkschulze Thanks, I found this article, and I understand as an anonymous structure in a union is not problematic C11 (not C++11). So Skia would not change about this (until someday in the future they care about legacy compilers). Unfortunately, we cannot specify both of the std versions of C and C++ at the same time, so, the only available option for us is "-Wno-pedantic". Maybe future C++ would permit such anonymous structure in an union, but requesting newer C++ std is reverting your past effort to accept older C++ compiler (and I don't want to do that). It is possible for cmake to set special compiler options for specific sources (like this), so I would add -Wno-pedantic for SkiaSVGRenderer.cpp, like b229d2c If anybody thinks as "if so, please separate the rotation function to another file, to minimize the effect of the special compiler option", please let me know, I can do that easily. |
* take <sk_sp>SkImage, return an oriented <sk_sp>SkImage or nullptr. * determine the orientation from EXIF info, by using SkCodec. * if the orientation is required, <sk_sp>SkImage is returned. * if the orientation is not needed, nullptr is returned. Add -Wno-pedantic (if not MSVC) to compile SkiaSVGRenderer.cpp, because skcms.h (required by SkCodec.h) requires C11 feature.
Just I've made a pull request #56, please review. |
* take <sk_sp>SkImage, return an oriented <sk_sp>SkImage or nullptr. * determine the orientation from EXIF info, by using SkCodec. * if the orientation is required, <sk_sp>SkImage is returned. * if the orientation is not needed, nullptr is returned. Add -Wno-pedantic (if not MSVC) to compile SkiaSVGRenderer.cpp, because skcms.h (required by SkCodec.h) requires C11 feature.
@dirkschulze Thanks! here I close this issue. |
Skia framework does not reflect the rotation info in EXIF of JPEG automatically. This sample SVG
jpg-color-gray.zip
is rendered like this:
The expected result (by my latest Cairo port) is looking like this:
This issue seems to be well known by Skia programmers, SkiaSharp Issue #836, flutter Issue #10533. In fact, there was a mention sounding as if it would be available in future version of Skia skia-discuss forum message in 2016.
I would try to include auto-orientation feature in Skia port.
The text was updated successfully, but these errors were encountered: