百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

paperclip-meta

> 后端框架
开源

为信封图像添加宽度、高度和大小。

159 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

为信封图像添加宽度、高度和大小。

Paperclip Meta

Add width, height, and size to paperclip images.

Paperclip Meta gets image dimensions after post_process_styles using paperclip's Geometry.from_file.

Paperclip Meta works with paperclip version 5.x and 6.x.

Version 2.x works with paperclip version 4.x.

Setup

Add paperclip-meta to Gemfile:

ruby
gem 'paperclip-meta'

Create migration to add a *_meta column:

ruby
class AddAvatarMetaToUsers  100
user.avatar.height(:medium)
=> 200
user.avatar.image_size
=> '60x70'
user.avatar.aspect_ratio
=> 1.5

You can pass the image style to these methods. If a style is not passed, the default style will be used.

Alternatives

https://github.com/thoughtbot/paperclip/wiki/Extracting-image-dimensions

Development

Test:

bash
bundle
bundle exec rake

Issues· 10 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rubyimagespapercliprailsruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类后端框架
定价开源

> 相关工具

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架