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

EPUB: improve SVG image output, closes #2766 #3396

Closed
wants to merge 1 commit into from
Closed

Conversation

mb21
Copy link
Collaborator

@mb21 mb21 commented Jan 30, 2017

This is not ready to merge yet...

Can we use System.Directory.doesFileExist instead of P.fetchItem somehow? Also, fetchItem appears to make pandoc fail if the file is not found even though I'm checking for :: PandocError (which I copied from the ICML writer).

@jgm
Copy link
Owner

jgm commented Jan 30, 2017 via email

@mb21
Copy link
Collaborator Author

mb21 commented Jan 30, 2017

Since you're in PandocMonad you can only use things defined there.

That's what I figured...

Of course, if it turns out we need something like doesFileExist there we could consider adding a function like that...

I'm not sure how smart the lazy evaluation of fetchItem is. But I suspect it will read the whole file into memory. So it feels cleaner to add a doesFileExist. Or should it be doesItemExist and try to fetch remote resources as well?

Is it failing with a PandocError?

I think it was, yes. Probably a PandocFileReadError (it was outputting problem reading media) The code that caused it was:

runExceptT $ lift $ P.fetchItem (writerSourceURL opts) src

I have now changed it to using catchError (do _ <- P.fetchItem ... but this seems somewhat of a hack... shouldn't the runExceptT change the exception to an either which can then be handled explicitly?

@jgm
Copy link
Owner

jgm commented Mar 15, 2017

If we end up merging some form of #2211, then we could simply generate the png fallback from the svg and we wouldn't need to check for its existence...

@mb21
Copy link
Collaborator Author

mb21 commented Mar 15, 2017

Good point. Instead, we could also use rasterific in a filter that does the necessary transformations on all referenced SVG images. (Depending on the output format it would fallback to png or pdf.) Then again, from a user perspective it's always nice to have more stuff built in.

@mb21
Copy link
Collaborator Author

mb21 commented Sep 26, 2018

This doesn't seem to be the right approach anymore. See e.g. #4058 (comment)

@mb21 mb21 closed this Sep 26, 2018
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.

2 participants