Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-14-2020, 09:21 PM   #1
The_book
Zealot
The_book began at the beginning.
 
Posts: 100
Karma: 10
Join Date: Aug 2019
Device: none
Change the media type after renaming?

When I run epubcheck plugin, I find that some of my images are named with wrong suffix name. After change the suffix name by renaming function, epubcheck plugin tells me that now in opf file the media type do not match.
So I want to know if your can change the media type after renaming?
The_book is offline   Reply With Quote
Old 02-14-2020, 09:34 PM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,569
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Sure. The manifest section of the opf file is where mimetypes are declared.
DiapDealer is offline   Reply With Quote
Old 02-14-2020, 09:52 PM   #3
The_book
Zealot
The_book began at the beginning.
 
Posts: 100
Karma: 10
Join Date: Aug 2019
Device: none
Quote:
Originally Posted by DiapDealer View Post
Sure. The manifest section of the opf file is where mimetypes are declared.
I know, and I can change it by editing the opf file. It is just that I think can be done by Sigil automatically.
If the mimetypes are decided by the suffix name, it should by change when rename the suffix name. If the mimetypes are decided by what the file exactly is, it should be the actual mimetype when files are added.
The_book is offline   Reply With Quote
Old 02-14-2020, 10:23 PM   #4
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,761
Karma: 5706256
Join Date: Nov 2009
Device: many
The mediatypes are determined by the opf manifest when the epub is first loaded. How on earth did you end up with both the wrong file extension and the wrong mediatype?

Why can't you just use find and replace to fix the opf?
KevinH is offline   Reply With Quote
Old 02-14-2020, 10:25 PM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,569
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by The_book View Post
I know, and I can change it by editing the opf file. It is just that I think can be done by Sigil automatically.
If the mimetypes are decided by the suffix name, it should by change when rename the suffix name. If the mimetypes are decided by what the file exactly is, it should be the actual mimetype when files are added.
Should's a funny word. I liked it better when you were asking rather than declaring how things "should" be.

Still, we'll take your "suggestion" under advisement.
DiapDealer is offline   Reply With Quote
Old 02-14-2020, 10:38 PM   #6
The_book
Zealot
The_book began at the beginning.
 
Posts: 100
Karma: 10
Join Date: Aug 2019
Device: none
Quote:
Originally Posted by KevinH View Post
The mediatypes are determined by the opf manifest when the epub is first loaded. How on earth did you end up with both the wrong file extension and the wrong mediatype?

Why can't you just use find and replace to fix the opf?
What I mean starts with a image file with wrong suffix name. When I import it into Sigil, Sigil use the suffix name to decide the opf manifest.At this time I have file with wrong suffix name and mediatype decided by the wrong suffix name. After using epubcheck, I find the wrong suffix name, and rename it.Now I have file with right suffix name and mediatype still decided by the wrong suffix name. Again, I use epubcheck, which tell me I have wrong mediatype.
The_book is offline   Reply With Quote
Old 02-14-2020, 11:59 PM   #7
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,190
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Perhaps a better request would be to have Sigil inspect the images during import to determine if the file type and image type match. I've seen the imghdr Python library used for testing and supplying information for renaming if needed (not sure but think Python3 required).

OTOH, when importing files with the wrong file type—"Garbage in, Garbage out" comes to mind—it might be better for the user to do some work before importing the image files. I might just be showing my paranoia but I tend to get nervous about files with incorrect file types. Am I the only one who remembers various forms of malware that hid themselves within images where one tactic was changing the image file type. It's a .png not a .jpeg so we won't check the EXIF data for instance.

@The_book: Since you know changing the file type when renaming the image file is going to trigger the mimetype error, why not change the mimetype at the same time?

Last edited by DNSB; 02-15-2020 at 12:28 AM.
DNSB is offline   Reply With Quote
Old 02-15-2020, 02:54 AM   #8
The_book
Zealot
The_book began at the beginning.
 
Posts: 100
Karma: 10
Join Date: Aug 2019
Device: none
Quote:
Originally Posted by DNSB View Post
@The_book: Since you know changing the file type when renaming the image file is going to trigger the mimetype error, why not change the mimetype at the same time?
Because I don't like to edit the opf file directly.I want Sigil to form and change the opf file automatically.
Also, since the mimetypes are deceded by the suffix name when imported, I enjoy the idea that when I change the suffix name, Sigil can change the opf file just like what happened when I import files.
The_book is offline   Reply With Quote
Old 02-15-2020, 03:47 PM   #9
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,190
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by The_book View Post
Because I don't like to edit the opf file directly.I want Sigil to form and change the opf file automatically.
Also, since the mimetypes are deceded by the suffix name when imported, I enjoy the idea that when I change the suffix name, Sigil can change the opf file just like what happened when I import files.
Given that the filetype for the image file is incorrect, as I said before: GIGO.

Perhaps you, as part of your work flow, should be checking the image files before importing them if this is happening often enough that you feel requesting that Sigil correct such files is worthwhile.

I will admit to being rather curious as to where you are obtaining those misnamed image files. Other than user error such as renaming all the images in a directory, I don't need to use more than both hands to count the number of such misnamed image files I've seen in the last 4 decades.
DNSB is offline   Reply With Quote
Old 02-15-2020, 05:50 PM   #10
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DNSB View Post
Given that the filetype for the image file is incorrect, as I said before: GIGO.

Perhaps you, as part of your work flow, should be checking the image files before importing them if this is happening often enough that you feel requesting that Sigil correct such files is worthwhile.

I will admit to being rather curious as to where you are obtaining those misnamed image files. Other than user error such as renaming all the images in a directory, I don't need to use more than both hands to count the number of such misnamed image files I've seen in the last 4 decades.
Really! You obviously don't filch stuff from pinterest, deviantart, etc

I bought a commercial graphic novel a few months ago, when I unpacked it I discovered all the so-called .webp files were in fact .png files. There are people out there who think changing the file extension will do the conversion.

BR
BetterRed is online now   Reply With Quote
Old 02-15-2020, 07:57 PM   #11
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,190
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by BetterRed View Post
Really! You obviously don't filch stuff from pinterest, deviantart, etc

I bought a commercial graphic novel a few months ago, when I unpacked it I discovered all the so-called .webp files were in fact .png files. There are people out there who think changing the file extension will do the conversion.

BR
Somewhat odd for someone who has made a career out of IT back to when minicomputers were all the rage but I am not that enthused about downloading images or most other files from the Internet. If shipping boxes of 8" floppies was good enough for the CP/MUG, it's good enough for me.

On a more serious note, when downloading image files, I treat them the same as any other file and scan them before moving them from the sandbox. There have been suggestions that I have paranoid tendencies but “It isn't paranoia if they're really out to get you.”
DNSB is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Q: media-type for TrueType fonts? phossler Editor 19 09-08-2023 11:06 PM
ttf media-type jcn363 Editor 3 01-30-2019 06:11 AM
media type in the manifest rubeus Plugins 24 05-14-2015 12:16 PM
Buy vs licence in another media type murraypaul General Discussions 15 06-11-2013 11:11 PM
media-type me too ePub 5 08-07-2012 05:32 PM


All times are GMT -4. The time now is 03:49 AM.


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