[poppler] Followup Bug 32349 & Poppler: More shading fun ;-)

Thomas Freitag Thomas.Freitag at kabelmail.de
Wed Dec 29 02:09:39 PST 2010


Am 29.12.2010 10:13, schrieb Thomas Freitag:
> Am 28.12.2010 16:51, schrieb Albert Astals Cid:
>> A Dimarts, 28 de desembre de 2010, vàreu escriure:
>>> Am 27.12.2010 19:40, schrieb Albert Astals Cid:
>>>> A Dilluns, 27 de desembre de 2010, Thomas Freitag va escriure:
>>>>> Thanks for immediately starting regtesting.
>>>>> Thought You're in xmas vacation or have enough to do releasing 
>>>>> 0.16.0.
>>>>>
>>>>> Here the correction for the artefacts by pdftoppm, I made a small
>>>>> mistake when optimizing my code.
>>>> Found some more problems, i found a pdf in which it seems that a 
>>>> circle
>>>> is not totally filled, sending you the files.
>>>>
>>>> Albert
>>> Playing once again patch ping pong with You. Hope, we can finish the
>>> game until end of this week :-)
>>> This PDF was a real headscratcher: Okay, I had some rounding problems
>>> calculating the size of the bitmap needed for the pattern. But that
>>> wasn't the main reason. The main reason was that only the half of the
>>> circles are painted with radial pattern, and the clipping path was
>>> exactly on the diameter and the outer line of the circle. Therefore the
>>> use antialiasing has the effect, that is seems that the circles are not
>>> totally filled. You can see that in the middle line of the circles with
>>> the former patch.
>>> Because there is no way to decide on the values of the shading
>>> parameters wether to use antialiasing or not, I changed my mind with
>>> heavy heart not using antialiasing on radial shading pattern. At least
>>> the wine glass is still looking better.
>> I'm getting a out of memory error when rendering the second page of
>> 9af89586e41a631f6b114a7f7bc5beaf  1und1_DSL_Flyer_partner.pdf
>> i think you sent me this file, if you need it mail me and i'll send 
>> it back to
>> you again.
> No, I didn't send You this file, but You already sent me the link to 
> it because of bug 27208, so I have it.
>> The problem seems to be that when you calculate the scale in
>> SplashRadialPattern constructor it ends up being infinite which in 
>> tourn tries
>> to allocate a bitmap of infxinf in size which fails :D
> Yes, You're true. Changing the order a little bit, calculating width & 
> height before rounding the bounding box, solves it:
>
>   width = xMax - xMin;
>   height = yMax - yMin;
>   xMin = splashRound(xMin);
>   xMax = splashRound(xMax);
>   yMin = splashRound(yMin);
>   yMax = splashRound(yMax);
>
> BUT: pdftoppm crashes with page two in Splash::blitTransparent(), so 
> not in the new routines, but I want to solve that, too, before sending 
> You a complete new patch.
I have it: The problem is in SplashOutputDev::beginTransparencyGroup, if 
ty > bitmap->getHeight(), ty is set to ty = bitmap->getHeight(). But 
that means that in Splash::blitTransparent() one line behind the bitmap 
is copied. I don't really know, if it is better to copy nothing or to 
copy just the last line, but copying nothing probably leads to other 
problems in endTransparencyGroup, so it's easier to copy just the last 
line. But if this causes new regressions, we can try to change that. So 
please regtest the new patch.
BTW, I change the constructor of SplashRadialPattern a little bit more 
to not only avoid infinite values.

Thomas
>
> Thomas
>
>> Albert
>>
>>> Please try the new attached patch,
>>> Thomas
>>>
>>>>> Thomas
>>>>>
>>>>> Am 27.12.2010 02:07, schrieb Albert Astals Cid:
>>>>>> A Dilluns, 27 de desembre de 2010, Albert Astals Cid va escriure:
>>>>>>> A Diumenge, 26 de desembre de 2010, Thomas Freitag va escriure:
>>>>>>>> Am 04.11.2010 22:26, schrieb Albert Astals Cid:
>>>>>>>>> Hi, i just commited the patch to splash with antialias and 
>>>>>>>>> shadings,
>>>>>>>>> really good work!
>>>>>>>>>
>>>>>>>>> Now, it seems you are both magicians so i'm asking another 
>>>>>>>>> wish :D
>>>>>>>>>
>>>>>>>>> Of course only do this if you feel like it's fun ;-)
>>>>>>>>>
>>>>>>>>> Have a look at the ducks and roses at
>>>>>>>>> http://www.acquerra.com.au/poppler/img_0.pdf
>>>>>>>>>
>>>>>>>>> Do you guys feel like trying to fix it?
>>>>>>>>>
>>>>>>>>> Albert
>>>>>>>> Hi Albert!
>>>>>>>>
>>>>>>>> As I already mentioned, I had a deeper look at the ducks&    
>>>>>>>> roses,
>>>>>>>> and espially at the wine glass.
>>>>>>>> I encountered, that there is no way to solve that in Gfx.cc, and
>>>>>>>> therefore I implemented radial shading in SplashOutputDev now. It
>>>>>>>> took me "some" days, more effort then I thought before beginning,
>>>>>>>> but the result is really beautiful, therefore I attach not only 
>>>>>>>> the
>>>>>>>> patch but the rendering result too, so that You can immediately
>>>>>>>> what I mean with beautiful :-)
>>>>>>>>
>>>>>>>> Take it a belated xmas gift for the poppler community :-)
>>>>>>> Good work :-)
>>>>>>>
>>>>>>> I've found a regression though, if you run pdftotext with and 
>>>>>>> without
>>>>>>> the pdf file i'll send you in private, you'll see that the lower 
>>>>>>> left
>>>>>>> square has some "random" white pixels that are not there without 
>>>>>>> the
>>>>>>> patch.
>>>>>> s/pdftotext/pdftoppm :D
>>>>>>
>>>>>> Albert
>>>>>>
>>>>>>> Albert
>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> Thomas
>>>>>>> _______________________________________________
>>>>>>> poppler mailing list
>>>>>>> poppler at lists.freedesktop.org
>>>>>>> http://lists.freedesktop.org/mailman/listinfo/poppler
>>>>>> _______________________________________________
>>>>>> poppler mailing list
>>>>>> poppler at lists.freedesktop.org
>>>>>> http://lists.freedesktop.org/mailman/listinfo/poppler
>>>>>>
>>>>>> .
>>>> _______________________________________________
>>>> poppler mailing list
>>>> poppler at lists.freedesktop.org
>>>> http://lists.freedesktop.org/mailman/listinfo/poppler
>>>>
>>>> .
>> _______________________________________________
>> poppler mailing list
>> poppler at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/poppler
>>
>> .
>>
>
>
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
>
> .
>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: radialsh.patch
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20101229/f10369e7/attachment.txt>


More information about the poppler mailing list