Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 08-19-2020, 10:18 AM   #1
Sarmat89
Fanatic
Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.
 
Posts: 516
Karma: 2268308
Join Date: Nov 2015
Device: none
PNG images lost in conversion

I'm trying to convert an EPUB file to the FB2 format. All PNG images are converted into JPEG for some reason.

The conversion log:

Code:
J:\Calibre Portable\Calibre\app\pylib.zip\dateutil\parser.py:601: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
Conversion options changed from defaults:
  verbose: 2
  filter_css: u',color,padding-top,padding-left,background-color,padding-right,padding,padding-bottom,background'
  sectionize: u'nothing'
  fb2_genre: u'sf_fantasy'
  chapter: u"//*[((name()='h1' or name()='h2' or name()='h3' or name()='h4' or name()='h5') and re:test(., '\\s*((chapter|book|section|part|\u0447\u0430\u0441\u0442\u044c|\u0433\u043b\u0430\u0432\u0430|\u043a\u043d\u0438\u0433\u0430)\\s+)|([IVX0-9]+\\.\\s+)|((prolog|prologue|epilogue|\u043f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435|\u043f\u0440\u043e\u043b\u043e\u0433|\u044d\u043f\u0438\u043b\u043e\u0433)(\\s+|$))', 'i')) or @class = 'chapter']"
  read_metadata_from_opf: u'%TEMP%\\calibre_dzsy1r\\gl_4da.opf'
  cover: u'%TEMP%\\calibre_dzsy1r\\lompf9.jpeg'
  output_profile: 'generic_eink'
Resolved conversion options
calibre version: 3.38.1
{'asciiize': False,
 'author_sort': None,
 'authors': None,
 'base_font_size': 0.0,
 'book_producer': None,
 'change_justification': u'original',
 'chapter': u"//*[((name()='h1' or name()='h2' or name()='h3' or name()='h4' or name()='h5') and re:test(., '\\s*((chapter|book|section|part|\u0447\u0430\u0441\u0442\u044c|\u0433\u043b\u0430\u0432\u0430|\u043a\u043d\u0438\u0433\u0430)\\s+)|([IVX0-9]+\\.\\s+)|((prolog|prologue|epilogue|\u043f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435|\u043f\u0440\u043e\u043b\u043e\u0433|\u044d\u043f\u0438\u043b\u043e\u0433)(\\s+|$))', 'i')) or @class = 'chapter']",
 'chapter_mark': u'pagebreak',
 'comments': None,
 'cover': u'%TEMP%\\calibre_dzsy1r\\lompf9.jpeg',
 'debug_pipeline': None,
 'dehyphenate': True,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': False,
 'duplicate_links_in_toc': False,
 'embed_all_fonts': False,
 'embed_font_family': None,
 'enable_heuristics': False,
 'expand_css': False,
 'extra_css': None,
 'fb2_genre': u'sf_fantasy',
 'filter_css': u',color,padding-top,padding-left,background-color,padding-right,padding,padding-bottom,background',
 'fix_indents': True,
 'font_size_mapping': None,
 'format_scene_breaks': True,
 'html_unwrap_factor': 0.4,
 'input_encoding': None,
 'input_profile': <calibre.customize.profiles.InputProfile object at 0x02E71510>,
 'insert_blank_line': False,
 'insert_blank_line_size': 0.5,
 'insert_metadata': False,
 'isbn': None,
 'italicize_common_cases': True,
 'keep_ligatures': False,
 'language': None,
 'level1_toc': None,
 'level2_toc': None,
 'level3_toc': None,
 'line_height': 0.0,
 'linearize_tables': False,
 'margin_bottom': 5.0,
 'margin_left': 5.0,
 'margin_right': 5.0,
 'margin_top': 5.0,
 'markup_chapter_headings': True,
 'max_toc_links': 50,
 'minimum_line_height': 120.0,
 'no_chapters_in_toc': False,
 'no_inline_navbars': False,
 'output_profile': <calibre.customize.profiles.GenericEink object at 0x02E71710>,
 'page_breaks_before': u'/',
 'prefer_metadata_cover': False,
 'pretty_print': False,
 'pubdate': None,
 'publisher': None,
 'rating': None,
 'read_metadata_from_opf': u'%TEMP%\\calibre_dzsy1r\\gl_4da.opf',
 'remove_fake_margins': True,
 'remove_first_image': False,
 'remove_paragraph_spacing': False,
 'remove_paragraph_spacing_indent_size': 1.5,
 'renumber_headings': True,
 'replace_scene_breaks': u'',
 'search_replace': '[]',
 'sectionize': u'nothing',
 'series': None,
 'series_index': None,
 'smarten_punctuation': False,
 'sr1_replace': None,
 'sr1_search': None,
 'sr2_replace': None,
 'sr2_search': None,
 'sr3_replace': None,
 'sr3_search': None,
 'start_reading_at': None,
 'subset_embedded_fonts': False,
 'tags': None,
 'timestamp': None,
 'title': None,
 'title_sort': None,
 'toc_filter': None,
 'toc_threshold': 6,
 'transform_css_rules': '[]',
 'unsmarten_punctuation': False,
 'unwrap_lines': True,
 'use_auto_toc': False,
 'verbose': 2}
InputFormatPlugin: EPUB Input running
on %TEMP%\calibre_dzsy1r\gygeqr.epub
Parsing all content...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/main.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Styles/sgc_styles.css ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Styles/main.css ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Parsing OEBPS/Text/blah.xhtml ...
Reading TOC from NCX...
Merging user specified metadata...
Detecting structure...
Flattening CSS and remapping font sizes...
Filtering CSS properties: , background-color, padding-left, padding-top, background, padding-bottom, padding, padding-right, color
Source base font size is 12.00000pt
Removing fake margins...
Found 8 items of level: p_2
Found 1086 items of level: p_1
Found 46 items of level: div_1
Found 1 items of level: div_2
Ignoring level p_2
p_1  left margin stats: Counter({u'0': 1086})
p_1  right margin stats: Counter({u'0': 1086})
div_1  left margin stats: Counter()
div_1  right margin stats: Counter()
div_2  left margin stats: Counter()
div_2  right margin stats: Counter()
Cleaning up manifest...
Trimming unused files from manifest...
Creating FB2 Output...
Rasterizing SVG images...
Converting XHTML to FB2 markup...
Converting OEBPS/Text/main.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
Converting OEBPS/Text/blah.xhtml to FictionBook2 XML
FB2 output written to %TEMP%\calibre_dzsy1r\j76xqm.fb2
Sarmat89 is offline   Reply With Quote
Old 08-19-2020, 11:15 AM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,108
Karma: 168961902
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Sarmat89 View Post
I'm trying to convert an EPUB file to the FB2 format. All PNG images are converted into JPEG for some reason.
I was under the impression that a FB2 ebook file stored images as Base64 encoded blobs. Personally, I was not impressed the one time I converted some epubs to fb2 for a friend. A simple epub with 7 or 8 full page images went from 12.8MiB to 207.4Mib.

Just looked at that old conversion and the Base64 images show as:

6 as <binary id="img_5" content-type="image/png"> ... </binary>

2 as <binary id="img_0" content-type="image/jpeg"> ... </binary>

The original images are 1 GIF, 1 TIFF, 4 PNG and 2 JPEG ( 1 of the jpegs is in an svg wrapper). The bolded number varies from 0 to 7.

Last edited by DNSB; 08-19-2020 at 11:25 AM. Reason: Added old conversion image type comment
DNSB is offline   Reply With Quote
Advert
Old 08-19-2020, 11:16 AM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,338
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The only way that can happen is if your png files dont have png mimetypes/extensions.
kovidgoyal is offline   Reply With Quote
Old 08-19-2020, 11:54 AM   #4
Sarmat89
Fanatic
Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.
 
Posts: 516
Karma: 2268308
Join Date: Nov 2015
Device: none
No, they have png extension and image/png MIME type.
Here is an example file which illustrates the problem.
Attached Files
File Type: epub test.epub (2.2 KB, 190 views)
Sarmat89 is offline   Reply With Quote
Old 08-19-2020, 12:43 PM   #5
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,108
Karma: 168961902
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Sarmat89 View Post
No, they have png extension and image/png MIME type.
Here is an example file which illustrates the problem.
I have to agree something odd is happening here. The filetype is showing as jpeg in the converted FB2 file. I then wrapped the image in svg and the file type showed as png. I've attached the two FB2 output files in a .zip file.

Over to the devs...

Code:
    <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 75 27" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink"><image height="75" width="27" xlink:href="../Images/image.png"/></svg>
  </div>

Last edited by DNSB; 08-19-2020 at 01:45 PM.
DNSB is offline   Reply With Quote
Advert
Old 08-19-2020, 01:11 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,338
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Converts to PNG for me, see attached. What OS/calibre version?
Attached Files
File Type: zip test.fb2.zip (888 Bytes, 192 views)
kovidgoyal is offline   Reply With Quote
Old 08-19-2020, 01:12 PM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,338
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
From your log I see you are using 3.38, that's no longer supported. Upgrade.
kovidgoyal is offline   Reply With Quote
Old 08-21-2020, 05:24 PM   #8
Sarmat89
Fanatic
Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.
 
Posts: 516
Karma: 2268308
Join Date: Nov 2015
Device: none
Good, I see it was fixed.
Sarmat89 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting pdf to png images roger64 Workshop 8 09-06-2019 05:58 PM
PNG images losing quality. piau9000 Calibre 6 02-03-2018 01:02 PM
Images Lost in Conversion Mooninite1 Conversion 0 02-27-2015 11:28 AM
help mobi to epub conversion: lost all images Sylver Calibre 10 01-13-2011 08:31 PM
Image and text- images lost in conversion monkeywithscisso Calibre 3 01-14-2009 10:01 PM


All times are GMT -4. The time now is 07:20 AM.


MobileRead.com is a privately owned, operated and funded community.