Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a reset for the Engine's internal images array #80

Closed
wants to merge 1 commit into from
Closed

Added a reset for the Engine's internal images array #80

wants to merge 1 commit into from

Conversation

ramondelafuente
Copy link
Contributor

The engine currently keeps a hash of path => data presumably to allow optimizing for header/footer images on multilpe pages.

We are using the PHPdf library with the Symfony Bundle. We wrote a console command that runs forever, and generates single-page PDF's in a loop. Each page has a QR code, which get generated on disk in the same loop cycle.

With the current Engine, we have two options, both problematic:

  • If we use the same filename for the QR code images, only the first image wll ever be loaded from disk
  • If we use different filenames for the QR code images, all images will remain in the Engine memory and never be cleared.

This patch simply clears the internal Images array on reset().

@verschoof
Copy link

@psliwa can you consider this PR?
👍

@psliwa
Copy link
Owner

psliwa commented Oct 22, 2014

Yes, of course. Thanks @ramondelafuente for PR. I've marged that PR manually, because I wanted to merge it also to 1.2.x branch: b82a5d4

@psliwa psliwa closed this Oct 22, 2014
@ramondelafuente
Copy link
Contributor Author

Nice! Thanks for the quick response.

@ramondelafuente
Copy link
Contributor Author

Will you be making a new tag/release soon?

@ramondelafuente ramondelafuente deleted the patch-reset-images-in-engine branch October 22, 2014 21:04
@psliwa
Copy link
Owner

psliwa commented Oct 22, 2014

Ok, I've created 1.2.5 tag with that fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants