# File lib/paperclip/geometry_transformation.rb, line 21
    def transformed_by (other)
      other = Geometry.parse(other) unless other.is_a? Geometry
      # if the two geometries are similar, or the destination geometry is a fixed size, the resulting dimensions are fixed
      return other.without_modifier if self =~ other || ['#', '!', '^'].include?(other.modifier)
      # otherwise, we apply the transformation
      raise TransformationError, "geometry is not transformable without both width and height" if self.height == 0 or self.width == 0
      case other.modifier
      when '>'
        (other.width < self.width || other.height < self.height) ? scaled_to_fit(other) : self
      when '<'
        (other.width > self.width && other.height > self.height) ? scaled_to_fit(other) : self
      when '%'
        scaled_by(other)
      when '@'
        scaled_by(other.width * 100 / (self.width * self.height))
      else
        scaled_to_fit(other)
      end
    end