Skip to content

Fail convert if "convert_to" consists of three parts #27

Open

Description

@arnisoft

To convert a document to HTML with embdedded images, you must use convert_to param 'html:HTML:EmbedImages'.
For example:
Libreconv.convert('document.docx', '/Users/ricn/pdf_documents/my_document_as.html', nil, 'html:HTML:EmbedImages')

But this code fail at

target_tmp_file = File.join(
          target_path,
          File.basename(@escaped_source_path, '.*') + '.' +
            File.basename(@convert_to, ':*')
        )

because generating output filename extension File.basename(@convert_to, ':*') returns 'html:HTML'.
This is incorrect filename extension.

I think code
File.basename(@convert_to, ':*')
must be replaced by something like this
@convert_to.split(':').first

Activity

  1. ndbroadbent commented on Oct 14, 2019

    @ndbroadbent
    Member

    Ah, thanks for letting me know about that! Would you have some time to add a new test case for a doc with embedded images? The test could ensure that the HTML contains some expected test, and the the images are embedded properly. It would be great if you could please submit a PR to fix this issue. Thanks!

  2. added a commit that references this issue on Apr 13, 2023
    5cff65d
  3. yhirano55 commented on Apr 13, 2023

    @yhirano55

    @ndbroadbent Pull request #35 has resolved this issue. Could you please review the changes and confirm that they have addressed the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions