Add README and crates.io metadata
Signed-off-by: trivernis <trivernis@protonmail.com>pull/4/head
parent
cf3ad87360
commit
a18bafb39e
@ -1,2 +1,3 @@
|
||||
/target
|
||||
Cargo.lock
|
||||
.idea
|
@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DiscordProjectSettings">
|
||||
<option name="show" value="ASK" />
|
||||
<option name="description" value="" />
|
||||
</component>
|
||||
</project>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/thumbnailer.iml" filepath="$PROJECT_DIR$/.idea/thumbnailer.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="CPP_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,35 @@
|
||||
# Thumbnailer
|
||||
|
||||
This crate can be used to create thumbnails for all kinds of files.
|
||||
|
||||
## Usage
|
||||
|
||||
```rust
|
||||
use thumbnailer::{create_thumbnails, Thumbnail, ThumbnailSize};
|
||||
use std::fs::File;
|
||||
use std::io::BufReader;
|
||||
|
||||
fn main() {
|
||||
let file = File::open("tests/assets/test.png").unwrap();
|
||||
let reader = BufReader::new(file);
|
||||
let mut thumbnails = create_thumbnails(reader, mime::IMAGE_PNG, [ThumbnailSize::Small, ThumbnailSize::Medium]).unwrap();
|
||||
|
||||
let thumbnail = thumbnails.pop().unwrap();
|
||||
let mut buf = Vec::new();
|
||||
thumbnail.write_png(&mut buf).unwrap();
|
||||
}
|
||||
```
|
||||
|
||||
## Supported media types
|
||||
|
||||
| Type | Subtype |
|
||||
|-------|---------|
|
||||
| Image | Png |
|
||||
| Image | Bmp |
|
||||
| image | Jpeg |
|
||||
| Image | Webp |
|
||||
| Image | Gif |
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
Loading…
Reference in New Issue