RESOLVED FIXED 95299
[GTK][WPE] Missing Exif Orientation support
https://bugs.webkit.org/show_bug.cgi?id=95299
Summary [GTK][WPE] Missing Exif Orientation support
Chris Dumez
Reported 2012-08-29 00:09:46 PDT
EFL port does not support EXIF orientation. This is covered by: fast/images/exif-orientation.html fast/images/exif-orientation-css.html
Attachments
WIP patch updating Cairo::drawSurface (11.55 KB, patch)
2020-04-07 07:51 PDT, Lauro Moura
no flags
Patch addressing comments. (11.37 KB, patch)
2020-08-06 21:34 PDT, Lauro Moura
no flags
Dominik Röttsches (drott)
Comment 1 2012-10-31 07:05:21 PDT
*** Bug 100852 has been marked as a duplicate of this bug. ***
Csaba Osztrogonác
Comment 2 2012-11-04 04:18:10 PST
*** Bug 101035 has been marked as a duplicate of this bug. ***
Zan Dobersek
Comment 3 2012-11-04 23:15:55 PST
fast/images/exif-orientation-image-document.html was introduced in r132877, failing as well. Already skipped on EFL. http://trac.webkit.org/changeset/132877
Dominik Röttsches (drott)
Comment 4 2012-11-05 03:58:59 PST
The decoding side seems alright. The issue is in the graphics backend. The backend needs to rotate/flip the graphics context and draw the BitmapImage according to ImageFrame orientation. Will handle that for cairo in bug 101207.
Michael Catanzaro
Comment 5 2017-06-07 19:45:59 PDT
Reassigning some EFL bugs that are likely shared with GTK/WPE to the GTK component.
Lauro Moura
Comment 6 2020-04-07 07:51:24 PDT
Created attachment 395680 [details] WIP patch updating Cairo::drawSurface drawSurface was ignoring the destRect transformations from drawNativeImage, applying some padding and wrong scaling, presuming src and dest had the same orientation. This first version fixes a bunch of the exif tests, with some failures left for border images and image-orientation tests. Still need to check for side effects in other image tests.
Adrian Perez
Comment 7 2020-07-23 14:52:28 PDT
Comment on attachment 395680 [details] WIP patch updating Cairo::drawSurface View in context: https://bugs.webkit.org/attachment.cgi?id=395680&action=review > Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:890 > +void drawSurface(PlatformContextCairo& platformContext, cairo_surface_t* surface, const FloatRect& destRect, const FloatRect& originalSrcRect, InterpolationQuality imageInterpolationQuality, float globalAlpha, const ShadowState& shadowState, bool didUseWidthAsHeight) In general we tend to frown upon boolean flags; instead, it's better to use an “enum”, which is more descriptive: // Somewhere in the header. enum class Sizing { Normal, WidthAsHeight }; void drawSurface(/* ... */, Sizing sizing = Sizing::Normal); (Also you may want to have a default value for the parameter, so you don't need to add the usual one by hand on some callsites. Also feel free to suggest a better name for the “enum”, I just wrote down the first thing that came to mind.) > Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:952 > + std::fabs(srcRect.height() / destRect.width()); The result of the calculations here are not being stored anywhere, which means the computed values are not used at all. Same below in the “else” branch. > Source/WebKit/Shared/cairo/ShareableBitmapCairo.cpp:79 > + Cairo::drawSurface(*context.platformContext(), surface.get(), destRect, srcRect, state.imageInterpolationQuality, state.alpha, Cairo::ShadowState(state), false); If you add a default value to the function prototype as suggested, you don't need to modify this callsite. > Source/WebKit/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:58 > + Cairo::drawSurface(*graphicsContext->platformContext(), surface, IntRect(IntPoint(), imageSize), IntRect(IntPoint(), imageSize), state.imageInterpolationQuality, state.alpha, Cairo::ShadowState(state), false); Ditto.
Lauro Moura
Comment 8 2020-08-06 15:08:14 PDT
*** Bug 215164 has been marked as a duplicate of this bug. ***
Lauro Moura
Comment 9 2020-08-06 21:34:22 PDT
Created attachment 406152 [details] Patch addressing comments.
Lauro Moura
Comment 10 2020-08-06 21:42:03 PDT
(In reply to Adrian Perez from comment #7) > Comment on attachment 395680 [details] > WIP patch updating Cairo::drawSurface > > View in context: > https://bugs.webkit.org/attachment.cgi?id=395680&action=review Thanks for the review, Adrian. > > > Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:890 > > +void drawSurface(PlatformContextCairo& platformContext, cairo_surface_t* surface, const FloatRect& destRect, const FloatRect& originalSrcRect, InterpolationQuality imageInterpolationQuality, float globalAlpha, const ShadowState& shadowState, bool didUseWidthAsHeight) > > In general we tend to frown upon boolean flags; instead, it's better to use > an “enum”, which is more descriptive: > > // Somewhere in the header. > enum class Sizing { Normal, WidthAsHeight }; > > void drawSurface(/* ... */, Sizing sizing = Sizing::Normal); > > (Also you may want to have a default value for the parameter, so you don't > need > to add the usual one by hand on some callsites. Also feel free to suggest a > better > name for the “enum”, I just wrote down the first thing that came to mind.) Indeed bools for flags are not that great. > > > Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:952 > > + std::fabs(srcRect.height() / destRect.width()); > > The result of the calculations here are not being stored anywhere, > which means the computed values are not used at all. Same below in > the “else” branch. > Oops. Must have missed adding it when git-add'ing the patch. The updated version is still working for all tests in fast/images except these two below, which seem to be arriving at drawSurface with some different orientation from FromImage. fast/images/exif-orientation-border-image.html fast/images/exif-orientation-background-image-repeat.html
Carlos Alberto Lopez Perez
Comment 11 2020-09-30 19:26:12 PDT
Comment on attachment 406152 [details] Patch addressing comments. This looks fine to me!
Adrian Perez
Comment 12 2020-10-02 14:15:54 PDT
Patch LGTM as well 👍️ Lauro, feel free to go ahead and land the patch, or set the commit queue flag :)
Michael Catanzaro
Comment 13 2020-10-08 05:38:26 PDT
Comment on attachment 406152 [details] Patch addressing comments. I'm going to do a drive-by cq+ to see if it lands without conflicts.
EWS
Comment 14 2020-10-08 05:40:36 PDT
Committed r268176: <https://trac.webkit.org/changeset/268176> All reviewed patches have been landed. Closing bug and clearing flags on attachment 406152 [details].
Note You need to log in before you can comment on or make changes to this bug.