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

SVG handling #305

Open
jayvdb opened this issue Jun 6, 2016 · 8 comments
Open

SVG handling #305

jayvdb opened this issue Jun 6, 2016 · 8 comments
Milestone

Comments

@jayvdb
Copy link

jayvdb commented Jun 6, 2016

SVG's are partially understood, with the correct mime type.

e.g. https://upload.wikimedia.org/wikipedia/commons/e/e9/Brodnopis_i_pioro.svg
results are

$ guessit Brodnopis_i_pioro.svg
For: Brodnopis_i_pioro.svg
GuessIt found: {
    "title": "Brodnopis i pioro svg", 
    "mimetype": "image/svg+xml", 
    "type": "movie"
}

However it isn't a movie, and the title should not contain svg as that was from the extension.

@jayvdb
Copy link
Author

jayvdb commented Jun 6, 2016

This is possibly related to #273

@Toilal
Copy link
Member

Toilal commented Jun 7, 2016

why do you try to feed guessit with svg files ? I'm not sure it's guessit responsibility to filter out image filetypes.

@jayvdb
Copy link
Author

jayvdb commented Jun 7, 2016

It would be nice to use guessit as part of heuristics to guess whether a file (on a remote server) of an unknown type is likely to be a movie, or some other class, as it is incredibly cheap to run guessit compared to downloading and analysing the file. .svg is just an example. It would be great if guessit said 'unknown' for types it doesnt recognise. If you're not interested, feel free to close.

@Toilal
Copy link
Member

Toilal commented Jun 7, 2016

I think it was the behavior in guessit 1.x, but this "feature" has been dropped during the 2.x rewriting. I let the issue open, i'll think about it.

@labrys
Copy link
Contributor

labrys commented Jun 7, 2016

@Toilal detection of image media types would be helpful for show-art

@Toilal
Copy link
Member

Toilal commented Jun 8, 2016

I understand and it make sense. It could be based on mimetype, but i fear that it may leads to inconsistent results because mimetype property is delegated to native implementation, and various OS may lead to various results.

Maybe we could use a pure python library for mimetype guessing, and then rely on this to solve this issue.

@Toilal Toilal modified the milestones: 2.2, 2.3 Jun 17, 2016
@ratoaq2
Copy link
Member

ratoaq2 commented Feb 11, 2018

Maybe this can be useful: https://github.com/cdgriffith/puremagic

Shouldn't we detect image extensions as containers as well?

@labrys
Copy link
Contributor

labrys commented Jun 10, 2020

Kinda forgot about this issue, but @Toilal for filenames you could use mimetypes from the standard library to create your own mimetype registry so results are consistent across all platforms. It would take a little leg work to add any desired types, but shouldnt be too troublesome.

@ratoaq2 puremagic wouldn't work for instances where you just have the name but have not yet downloaded the file.

It looks like puremagic also does filename matching, so that could be an option too.

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

No branches or pull requests

4 participants