Skip to content

Commit

Permalink
Added documentation for StoreDimensions plugin. Bumped version.
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-alexandrov committed May 25, 2020
1 parent 6518bb6 commit 34986b3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,35 @@ image.metadata["custom_1"]
image.metadata["custom_2"]
```

### Store Dimensions

The `StoreDimensions` plugin extracts dimensions of uploaded images and stores them into the metadata.

``` crystal
class Uploader < Shrine
load_plugin(Shrine::Plugins::StoreDimensions,
analyzer: Shrine::Plugins::StoreDimensions::Tools::BuiltIn)
finalize_plugins!
end
```

``` crystal
image.metadata["width"]
image.metadata["height"]
```

**Analyzers**

The following analyzers are accepted:

| Name | Description |
|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `BuiltIn` | (**Default**). A built-in solution that wrapps ImageMagick's `identify` command |
| `Pixie` | Uses the [Pixie](https://github.com/watzon/pixie).




## Feature Progress

Expand All @@ -284,7 +313,7 @@ Items not marked as completed may have partial implementations.
- [X] #stream
- [X] #replace
- [X] #delete
- [ ] Shrine::Attacher
- [X] Shrine::Attacher
- [ ] Shrine::Attachment
- [ ] Shrine::Storage
- [X] Shrine::Storage::Memory
Expand Down
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: shrine
version: 0.5.2
version: 0.5.3
description: |
File Attachment toolkit for Crystal applications
Expand Down

0 comments on commit 34986b3

Please sign in to comment.