Skip to content
This repository was archived by the owner on Apr 30, 2024. It is now read-only.
This repository was archived by the owner on Apr 30, 2024. It is now read-only.

Asset#dimensions can break #13

@kintner

Description

@kintner

If you have an asset_updated_at column on your asset table this causes paperclip to append a timestamp on the url it generates. This breaks Asset#dimensions since it uses the thumbnail method to generate the path to the file. Instead you could use something like this

file = new_record? ? asset.instance_variable_get("@queued_for_write")[:original] : asset.path(size.to_sym)
geometry = Paperclip::Geometry.from_file(file)
[geometry.width.to_i, geometry.height.to_i]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions