summaryrefslogtreecommitdiff
path: root/vcl/source/filter/jpeg
AgeCommit message (Collapse)AuthorFilesLines
2018-02-05tdf#115416 allow build with classic libjpegCaolán McNamara1-1/+2
Change-Id: I96252e1a78dbc52d21095e11b7bdb0807e5d76b6 Reviewed-on: https://gerrit.libreoffice.org/49205 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-11-17ofz#4291 Direct-leakCaolán McNamara1-60/+70
can't reproduce this, but throw a guess at it Change-Id: Iff6198c463bbab4e3ef87ec62eaa13e88d016a23 Reviewed-on: https://gerrit.libreoffice.org/44890 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-16ofz#3002 set a limit to how broken a jpeg is to give up recoveringCaolán McNamara1-0/+20
take ImageMagicks 1000 warnings as the starting point Change-Id: Id685764404d27b151daf031a4860055f64dd0915 Reviewed-on: https://gerrit.libreoffice.org/44818 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-03loplugin:constparam in vcl,svtoolsNoel Grandin2-2/+2
Change-Id: I7a3eb2bfda869e9e66db919f929ead60cf8890a4 Reviewed-on: https://gerrit.libreoffice.org/44209 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-26vcl: make MapMode constructor explicitMichael Stahl1-1/+1
Insert constructor everywhere, except a couple places that apparently want to compare GetMapUnit(). Change-Id: I1910deb60562e5e949203435e827057f70a3f988
2017-10-23loplugin:includeform: vclStephan Bergmann3-5/+5
Change-Id: Id7dea3917740aaf4db8dada5e2bea6e117d714ea
2017-10-19Avoid throwing C++ exception across libjpeg C framesStephan Bergmann1-286/+321
It causes trouble at least for (non-debug) 32-bit ARM Flatpak builds, where CppunitTest_vcl_filters_test aborts with an uncaught css::uno::RuntimeException. This is a partial revert of 6889fa826eef6bd1074d77507818e71dfe8ba152 "rework jpeg error handling to throw rather than setjmp to avoid leaks", switching back to setjmp/longjmp but trying to keep the leaks fixed by introducing any relevant local variables before the setjmps. Change-Id: Ia5984528ea98be1c89a21aee800b247120f88a89 Reviewed-on: https://gerrit.libreoffice.org/43494 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-13Fix typoAndrea Gelmini1-1/+1
Change-Id: Icb23e192961aadcd23d17546aa397df18dd32979 Reviewed-on: https://gerrit.libreoffice.org/43366 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2017-08-17remove UL/L suffixes from integer constants on the RHS of expressionsNoel Grandin2-4/+4
Change-Id: I899a8126c9d971601fea6c77eca165718aea0ac5 Reviewed-on: https://gerrit.libreoffice.org/41237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-09Resolves: tdf#99286 for jpeg dpi use apis that know about MapUnit::MapPixelCaolán McNamara1-3/+3
move the code which can do this from sw to vcl Change-Id: I9940fb80ecdbfe8f70afc500c691288ed0993701 Reviewed-on: https://gerrit.libreoffice.org/40925 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-28loplugin:constparams handle constructorsNoel Grandin1-1/+1
had to change the structure of the plugin considerably, was too messy to structure it to do the calculations on a per-function basis Change-Id: I4edee7735f726101105c607368124a08dba21086 Reviewed-on: https://gerrit.libreoffice.org/40516 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-13loplugin:oncevar: empty strings: vclStephan Bergmann1-2/+1
Change-Id: Ic9a3b72dbff3333cba45b9ad4b75e8de12bc4c06
2017-05-18Revert "Fix typos"Stephan Bergmann1-1/+1
This reverts commit 26a67002fcb9381b54de6cae1aaa37120d49066a. "Iff" is not a typo, see 2a65bf32ec270484dcea4d22d3c93552dc0c24dd "Revert 'Typo: iff->if'".
2017-05-18Fix typosAndrea Gelmini1-1/+1
Only replaced "iff" with "if" Change-Id: Ib9dfa5c12b05500043147fe3b65f923b1b12a581 Reviewed-on: https://gerrit.libreoffice.org/37782 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-05-09cleanup osl/diagnose.h includesJochen Nitschke1-1/+0
with command > git grep -l osl/diagnose.h *.cxx | xargs grep -L -w 'OSL_\w*' | xargs sed -i '/#include *\(<\|\"\)osl\/diagnose.h\(>\|\"\).*/d' headers need more work Change-Id: I906519ebbd47a04703b4fa5943b2f7abea7a97ab Reviewed-on: https://gerrit.libreoffice.org/37350 Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-05-08vcl: split jpeg import into two partsMiklos Vajna6-33/+62
Split the import into two: 1) Just create the bitmap, this part is not thread-safe (e.g. OpenGLContext::makeCurrent() is called when OpenGL is enabled). 2) Import the image into an existing bitmap. The point is that the second part takes much more time than the first, and in the future that part may be executed on a thread, while without such a split the whole ImportJPEG() can't do that. For now GraphicFilter::ImportGraphic() simply invokes the two parts after each other, so no real functional changes yet. Change-Id: Iee742a2cd3c581aeaf1a1ed9f55cd543955a85e0 Reviewed-on: https://gerrit.libreoffice.org/37397 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-04-19vcl JPEG import: remove unused pCallerDataMiklos Vajna4-5/+5
Which is always set to nullptr, is passed around, finally just ignored. Change-Id: I81aecbed33ea249e63fbb412a54345fbb8335e47 Reviewed-on: https://gerrit.libreoffice.org/36662 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna1-1/+1
Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-03-25Fix typosAndrea Gelmini1-1/+1
Change-Id: I623135cd4c76dd6569f4ee521f97dee41de4cb1e Reviewed-on: https://gerrit.libreoffice.org/35660 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-23Remove unused #include <ctype.h>Stephan Bergmann1-1/+0
Change-Id: I8bf3e30687e20151a9e1936e69362abfe9b3a99d
2017-03-19ofz#909 timeout on converting gray scale jpgsCaolán McNamara1-33/+12
but we can remove the whole setting pixels one at a time because the format matches N8BitPal, and typically that's what we're writing to anyway, so a direct copy will do Change-Id: I91c72ec37055eb064d84461ac89b6bf171ef8d79 Reviewed-on: https://gerrit.libreoffice.org/35442 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-18noone cares about the return valueCaolán McNamara2-4/+2
Change-Id: I1f5e0ea481c39b92726812722d3f6f782f3cec9d
2017-03-18rework jpeg error handling to throw rather than setjmp to avoid leaksCaolán McNamara1-302/+313
Change-Id: I00e5041db7dcfb71d646438f7fda538d90ce6223 Reviewed-on: https://gerrit.libreoffice.org/35414 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-17ofz#889 readjust jpeg importCaolán McNamara1-3/+4
Change-Id: I4e25db429b8dee9265ab2ad468c21cc34a50df6c Reviewed-on: https://gerrit.libreoffice.org/35325 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-16avoid slow conversion between scanline format and dest formatCaolán McNamara1-26/+44
when we can, e.g. for the svp/gtk3 case Change-Id: I74f7b01004423f27ed2f142b325c2c74b4de290b Reviewed-on: https://gerrit.libreoffice.org/35229 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-16can set the out_color_space after jpeg_start_decompressCaolán McNamara1-14/+15
Change-Id: I8432f5147a3e73f0a4eafefceab7fbf715f58acf Reviewed-on: https://gerrit.libreoffice.org/35228 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-16reinstate utl::TempFile changeCaolán McNamara1-2/+4
This reverts commit 5411d99c0a7345e9c68ad55debcb20eecdc0b36a.
2017-03-15rollback utl::TempFile changeCaolán McNamara1-4/+2
2017-03-15Actually output the error messageStephan Bergmann1-0/+1
Change-Id: I09e23a4828f5c251687b35fa0b7c70c1018422c0
2017-03-15take pre-calculated size from vector::sizeCaolán McNamara1-2/+4
Change-Id: I5a7f2c4c67de48f3a34f311f69de3bfdb94423d5
2017-03-10mnFormerPos is unusedCaolán McNamara2-4/+1
Change-Id: I147b68882d99b8712625178e5206ea7c0f5f7401
2017-03-10min valid jpeg len is less than 512Caolán McNamara1-19/+0
our qa tests already include such, so this isn't right Change-Id: I86fb02bf353fb5b228db915f04db6e36cfb40c51
2017-03-10improve scopingCaolán McNamara1-3/+2
Change-Id: I2c7f607f05b07b7ec5453758910fdcb7f27ae697
2017-03-10ofz#799 stop decompressing if the file is truncatedCaolán McNamara3-11/+16
Change-Id: I4040ebbf7b21905b950f4af36012bc83aebaa320
2017-02-09convert BmpConversion to scoped enumNoel Grandin1-1/+1
and drop unused 4BIT_TRANS and 1BIT_MATRIX enumerators Also fix a bug in x11::convertBitmapDepth where we were incorrectly passing BmpConversion enumeratirs to ReduceColors Change-Id: I903c6866750e46ee752e10a17c05fcaaf6b11242 Reviewed-on: https://gerrit.libreoffice.org/34062 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-05Change Read/Write access to Scoped Read/Write accessMark Page2-5/+3
Change-Id: I4834d057e1997710f5ac9691d6c3eecb24e26881 Reviewed-on: https://gerrit.libreoffice.org/31550 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-09tdf#103801 JPEG - don't handle buffer orientation in importTomaž Vajngerl1-13/+0
We don't need to read buffer in reverse scanline order if image is bottom-up. This is handled by CopyScanline already. Change-Id: Ibb20978c01115743de8a457e56003d28ef6dd6d9 Reviewed-on: https://gerrit.libreoffice.org/30710 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-11-04loplugin:unnnecessaryvirtual in vclNoel Grandin3-7/+5
Change-Id: Ifa8bfafb2e527ce5976f3bd310d107cb2840a5f6 Reviewed-on: https://gerrit.libreoffice.org/30531 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-02loplugin:unusedfieldsNoel Grandin1-1/+0
Change-Id: I96634c18ba6600f8f7d5d04a162dcd7e1e312923 Reviewed-on: https://gerrit.libreoffice.org/30474 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-05convert MapUnit to scoped enumNoel Grandin1-3/+3
I left a prefix on the names "Map" so that I would not have to re-arrange each name too much, since I can't start identifiers with digits like "100thMM" And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore. Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224 Reviewed-on: https://gerrit.libreoffice.org/29096 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-04vcl: remove artificial image byte size limit in JPEG filterTomaž Vajngerl1-15/+0
When reading a JPEG image we limit the image raw byte size to a certain arbitrary value. This is not necessary and does not need to be enforced. Change-Id: Ia86ac2423f51a79eecf39d6afc0c81bb9b6ad1f1 Reviewed-on: https://gerrit.libreoffice.org/29521 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-10-04vcl: read image from JPEG one scanline at a timeTomaž Vajngerl3-247/+139
When reading an image from JPEG file we allocate a large buffer to hold the whole raw image before we read it into SalBitmap. If the image is large this step will spike the memory usage. This changes reading so that we allocate only the buffer for a scanline and read one scanline at a time. Change-Id: I405f4a14601e271c0293a2b75b4c9ec6c458d8a9 Reviewed-on: https://gerrit.libreoffice.org/29504 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-10-03loplugin:countusersofdefaultparams in sw..vclNoel Grandin1-1/+1
Change-Id: I152df55f5a30e073c66cfd3a64d5090a20cb232d Reviewed-on: https://gerrit.libreoffice.org/29471 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-18loplugin:unusedenumvaluesNoel Grandin1-5/+1
Change-Id: Icf17f936ce6d07d0e152252833c8645cf9b1163b Reviewed-on: https://gerrit.libreoffice.org/28942 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-15loplugin:countusersofdefaultparams in vclNoel Grandin1-1/+1
Change-Id: I046e6f16c5b171a06e2be2da2f72340634f3e979 Reviewed-on: https://gerrit.libreoffice.org/28891 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann1-1/+1
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-07-19clang-tidy performance-unnecessary-value-param in vclStephan Bergmann2-2/+2
Change-Id: I0b53c4bf5b4619cde357cf4eb432b153b1f7e6b5
2016-07-11Modify ImpGraphic class, GraphicReader context to use unique ptrMark Page1-14/+9
Change-Id: I51c3995f4a6e940a5235524eb94dd356b27ae8d7 Reviewed-on: https://gerrit.libreoffice.org/26955 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-06tools: rename SvStream::Read/Write to ReadBytes/WriteBytesMichael Stahl3-5/+5
Change-Id: Ib788a30d413436aa03f813aa2fddcbc4d6cd2f9a Reviewed-on: https://gerrit.libreoffice.org/25972 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-05-25Convert BMP_FORMAT to scoped enumNoel Grandin2-6/+6
Change-Id: I751ab762b6e6f961e9e73a8a2ca92a3f5a5eb1c8 Reviewed-on: https://gerrit.libreoffice.org/25189 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>