- Aug 02, 2019
-
-
Jo Shields authored
* Change to 6.0 for release. So many changes deserves a big number * Replace bugzilla link with github
-
Alexander Köplinger authored
-
Alexander Köplinger authored
Various instances of "Multiplication result may overflow 'unsigned int' before it is converted to 'size_t'."
-
- Aug 01, 2019
-
-
Frederik Carlier authored
Only a couple of `LineCap` values are accepted by GDI+. All other values are ignored, and silently reset to `LineCapFlat`. This behavior is covered by the `CustomLineCapTests` tests in corefx.
-
Frederik Carlier authored
* Make sure status is non-negative * Fix state check in GdipRestoreGraphics * Add additional check suggested by filipnavara
-
Frederik Carlier authored
fontconfig will not enumerate _any_ fonts if it cannot find a configuration file. This PR tries to set some sensible defaults in that scenario, so that at least the system-wide fonts can be found.
-
Alexander Köplinger authored
It was removed upstream so we need to include a copy of it. The upstream code is licensed as MIT. Fixes https://github.com/mono/libgdiplus/issues/546
-
Filip Navara authored
* Add C version of MeasureString_Wrapping_Dots test * Bump minimum Pango version to 1.40.14 to get fix for line breaking bug This is one funky bug... It works fine on macOS with Pango 1.42 and it doesn't work on Ubuntu 16.04 with Pango 1.38.1. The problem is that on Ubuntu the "." characters are not marked with "char_break" logical attribute so the Pango layout fails to insert a line break. On macOS all the characters have the "char_break" logical attribute and it returns the correct result. The fix in Pango was implemented in GNOME/pango@e8316c1#diff-3d8168315b940c3e9d29a4991735a9a7 so any version newer than 1.40.14 is fine.
-
Filip Navara authored
-
- Jul 31, 2019
-
-
Alexander Köplinger authored
The latter is a non-standard shell builtin. Fixes https://github.com/mono/libgdiplus/issues/555
-
Hugh Bellamy authored
Extracted from #530
-
Hugh Bellamy authored
Extracted from #530
-
Jeremy Kuhne authored
Having this hooked up allows for better rendering for two/three color displays. The text geometry isn't identical to Windows, but the aliasing is very similar, at least on Ubuntu running under the WSL. Note that CAIRO_ANTIALIAS_GRAY still generates non-gray pixels on Raspbian on RPi3B+. Presumably an issue with Cairo itself? I've included the results of running the code in #535 on Ubuntu. **Before** ![textaliasingubuntu](https://user-images.githubusercontent.com/8184940/53463703-8fe1ea00-39fc-11e9-9d0d-3b966b092f06.png) **After** ![ta2](https://user-images.githubusercontent.com/8184940/53463659-632dd280-39fc-11e9-86bc-de6e41250794.png) Fixes #535
-
Frederik Carlier authored
`GdipGetRegionScans` transforms `region` and stores the result in `work`. From that point on, all work is done on `work` and no longer on region. However, there still was a switch on `region->type` instead of `work->type` which would send `GdipGetRegionScans` down the wrong path if the type has changed. To make things worse, `gdip_region_convert_to_path` changes the `type` and clears `rects`, but did not reset `cnt` to 0. `RegionTests.GetRegionScans_CustomMatrix_TransformsRegionScans` in the corefx test suite could trigger this.
-
Frederik Carlier authored
Align with GDI+. Covered by `GraphicsPathTests.AddArc_ZeroWidthHeight_ThrowsArgumentException` and `GraphicsPathTests.AddPie_ZeroWidthHeight_ThrowsArgumentException` in corefx
-
Frederik Carlier authored
A gradient on from point A to itself doesn't make much sense, and GDI+ returns OOM. Make libgdiplus do the same thing. This is covered by the corefx `LinearGradientBrushTests.Ctor_EqualPoints_ThrowsOutOfMemoryException` test.
-
Frederik Carlier authored
If you create a new bitmap from scratch (that is, `scan0` is `NULL`), `GdipCreateBitmapFromScan0` will allocate memory to hold the raw bitmap data for you. It then attempts to initialize this. By default, it will `memset` all bytes to 0, so you should get a black image in most formats. However, for formats with alpha-channels, this would set alpha to `0`, causing the image to be "completely translucent black" (AKA white). So the method goes on a quest to set the alpha channel to 1. It iterates over the framebuffer using a 32-bit `ARGB` value. For pixel formats with < 32 bpp, this would cause a buffer overflow for the last pixel. Fix the check for the bpp, and make sure we really have a 32bpp pixel format.
-
Frederik Carlier authored
The first thing `GdipCreateFromHdc` does, is to cast this from `HDC` to `GpGraphics`. This is almost guaranteed to fail on Windows, and even something as simple as `clone->type` will cause an access violation. Instead, just return `NotImplemented` when compiled for Win32. A more robust strategy may be to keep track of all `GpGraphics` objects we allocate, and check whether `hdc` points to any of those, before casting `hdc` to `GpGraphics`.
-
Frederik Carlier authored
Similar to #557, assuming a `HICON` is a `GpImage` will very likely not work on Windows; so just return `NotImplemented` instead of risking taking down the entire process. Similar to #557, the corefx unit tests will call this with HICON set to a value of `0xa` (i.e. an invalid pointer), not sure how we can validate that pointer short of tracking all `GpGraphics` objects.
-
Frederik Carlier authored
`GdipCloneImageAttributes` would do a `memcpy` of the `ImageAttributes` class, but did not do deep cloning of reference values. This leads to double frees (and other erratic behavior) when disposing the original `GpImageAttributes` and its clone.
-
Frederik Carlier authored
GDI+ seems to map values between max(float) and infinity to max(float), instead of infinity. This is covered by a couple of tests in the corefx `MatrixTests` test suite. This PR updates libgdiplus so that it matches the observed GDI+ behavior.
-
Vitaliy Shibaev authored
* Fix clipping of non-rectangular paths (#547, #552) Clipping of paths and path-based regions was broken in 5dd3b5da. This commit fixes the issue. * graphics-cairo.c - do not pass NULL matrix to GdipGetRegionScansCount and GdipGetRegionScans * testclip.c - add test for clipping of paths and regions based on paths * Fix indent in test Fixes #547 Fixes #552
-
Vitaliy Shibaev authored
* Add failed tests for page unit and world transform dependency (#545) * test_world_transform_respects_page_unit_document - tests GdipSetWorldTransform and UnitDocument * test_world_transform_respects_page_unit_point - tests GdipTranslateWorldTransform and UnitPoint * Respect page units when passing transformation matrix to cairo (#545) * general.c - implement gdip_cairo_set_matrix function that converts translation part of a matrix from page units to cairo coordinates * graphics-cairo.c - fix typo when input parameter 'matrix' was not used * customlinecap.c, graphics-cairo.c, graphics.c, image.c, pen.c - use gdip_cairo_set_matrix instead of cairo_set_matrix when input matrix is expressed in page units * Fix clipping of non-rectangular paths (#547, #552) Clipping of paths and path-based regions was broken in 5dd3b5da. This commit fixes the issue. * graphics-cairo.c - do not pass NULL matrix to GdipGetRegionScansCount and GdipGetRegionScans * testclip.c - add test for clipping of paths and regions based on paths * Fix indent in test Fixes #545.
-
Benoit Merlet authored
This patch allows Garphics.MeasureString() and Graphics.DrawString() to correctly measure and draw unicode characters with a codepoint greater than 0xffff.
-
Günther Foidl authored
Fixes #443
-
Frederik Carlier authored
- In `gdip_process_bitmap_attributes`, check for `ImageAttributeFlagsNoOp`, and do not process any attributes if no-op is enabled - Implement gamma correction - Implement treshold correction - Correctly implement the clearing of flags (`imgattr->flags &= ~ImageAttributeFlagsX` instead of `imgattr->flags |= ~ImageAttributeFlagsX`) - Prototype CMYK channel support
-
MarcusCalhoun-Lopez authored
These flags were added [quite some time ago](https://github.com/mono/libgdiplus/commit/bce17c28c445c49e9349aace2eb0e4a9bd235aad). It is not entirely clear why they were needed since the original bug report is not easily accessible. `-no-cpp-precomp` either [does nothing or causes errors](http://www.mistys-internet.website/blog/blog/2013/10/20/no-cpp-precomp-the-compiler-flag-that-time-forgot/). `-flat_namespace -undefined suppress` is not a standard practice and causes [problems that are difficult to track down](https://trac.macports.org/ticket/24501).
-
Frederik Carlier authored
-
Alexander Köplinger authored
-
Alexander Köplinger authored
The Travis Linux build is using Ubuntu Xenial now with a new GCC, fix/disable the new warnings.
-
Frederik Carlier authored
-
Calvin Buckley authored
this is needed for AIX/PASE
-
- Mar 15, 2019
-
-
Alexander Köplinger authored
-
Alexander Köplinger authored
bmpcodec.c: Add out-of-bounds checks to memset of scan0 in gdip_read_bmp_rle_4bit() and gdip_read_bmp_rle_8bit()
-
Alexander Köplinger authored
Without the cast on the right-hand-side of the assignment the compiler would use the default int datatype so the overflow checking wasn't working.
-
Alexander Köplinger authored
If there's not enough data left in the buffer we'd still return "size" bytes read instead of "len".
-
Alexander Köplinger authored
bmpcodec.c: Add out-of-bounds checks to pixel array in gdip_read_bmp_rle_4bit() and gdip_read_bmp_rle_8bit()
-
Alexander Köplinger authored
To keep compatibility with Windows GDI+ we can't return an error even for malformed files.
-
Alexander Köplinger authored
According to the docs at (https://docs.microsoft.com/en-us/windows/desktop/gdi/bitmap-header-types) it's not allowed: > Run-length encoded (RLE) format bitmaps and BITMAPCOREHEADER bitmaps cannot be top-down bitmaps.
-
Alexander Köplinger authored
-