Skip to content

ImageProcesseror Loading #527

Description

@splitbrain

We use our own ImageProcessor

In the past we passed it as a config value to MPDF:

parent::__construct([
'mode' => $mode,
'format' => $format,
'default_font_size' => $fontsize,
'ImageProcessorClass' => DokuImageProcessorDecorator::class,
'tempDir' => _MPDF_TEMP_PATH, //$conf['tmpdir'] . '/tmp/dwpdf'
'SHYlang' => $docLang,
]);

Unfortunately this seems no longer be supported in MPDF (I'm not sure if this was ever supported or if we monkey patched our MPDF version).

The proper way would be to pass a custom $container to the constructor which would then be used by the internal ServiceFactory to load our class.

Unfortunately it seems the ImageDecorator is not loaded through that Factory.

So going forward I see two options:

  1. Monkey patch our MPDF library in the vendor directory (probably using a simple setImageDecorator() method)
  2. Use reflection to set the private property in our sub class

The second method would probably more future proof as there would be no need to reapply the patch on updates.

Any opinions?

PS: I will also open an issue upstream.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions