Re: [Podofo-users] Patch for GetFromResources to load colorspace

2018-03-11 Thread Matthew Brincke
Hello Christophe, hello all,
> On 10 February 2018 at 21:44 BLANCHARD Christophe 
>  wrote:
> 
> 
> Hello all,
> 
> This patch to make GetFromResources function supporting ColorSpace that can 
> be an array:
> 
> PdfObject* PdfPage::GetFromResources( const PdfName & rType, const PdfName & 
> rKey )
> {
> if( m_pResources->GetDictionary().HasKey( rType ) )
> {
> // OC 15.08.2010 BugFix: Ghostscript creates here sometimes 
> an indirect reference to a directory
> // PdfObject* pType = m_pResources->GetDictionary().GetKey( 
> rType );
> PdfObject* pType = m_pResources->GetIndirectKey( rType );
> if( pType->IsDictionary() && pType->GetDictionary().HasKey( 
> rKey ) )
> {
> PdfObject* pObj = pType->GetDictionary().GetKey( rKey 
> );// CB 08.12.2017 Can be an array
> if (pObj->IsReference()) {
> const PdfReference & ref = 
> pObj->GetReference();
> return 
> this->GetObject()->GetOwner()->GetObject( ref );
> }
> return pObj;  
>   // END
> }
> }
> 
> return NULL;
> }
> 

this patch looks fine, although it doesn't check for an entry being an array;
I don't think that's necessary at this time. I've received your email on Sun,
11 Feb 2018, 20:03 +0100 (CET), I'm sorry for answering it only an hour more
than a month later. As an aside: Patches submitted should be in attachments,
not in the mail body, except if extensive discussion of parts (which would
need to quoted) is foreseen.

I've committed your patch with minor (brace-style) alterations in svn r1910:
https://sourceforge.net/p/podofo/code/1910/

> Cordialement / Best Regards,
> Christophe BLANCHARD
> 

Best regards, mabri

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] Patch for GetFromResources to load colorspace

2018-02-11 Thread BLANCHARD Christophe
Hello all,

This patch to make GetFromResources function supporting ColorSpace that can be 
an array:

PdfObject* PdfPage::GetFromResources( const PdfName & rType, const PdfName & 
rKey )
{
if( m_pResources->GetDictionary().HasKey( rType ) )
{
// OC 15.08.2010 BugFix: Ghostscript creates here sometimes an 
indirect reference to a directory
// PdfObject* pType = m_pResources->GetDictionary().GetKey( 
rType );
PdfObject* pType = m_pResources->GetIndirectKey( rType );
if( pType->IsDictionary() && pType->GetDictionary().HasKey( 
rKey ) )
{
PdfObject* pObj = pType->GetDictionary().GetKey( rKey 
);// CB 08.12.2017 Can be an array
if (pObj->IsReference()) {
const PdfReference & ref = pObj->GetReference();
return 
this->GetObject()->GetOwner()->GetObject( ref );
}
return pObj;
// END
}
}

return NULL;
}

Cordialement / Best Regards,
Christophe BLANCHARD

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systemes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.

For other languages, go to http://www.3ds.com/terms/email-disclaimer

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users