The "constrain" filter seems to break when only one dimension is provided like used in the "Nova" Big Cartel theme. For example:
{{ image | product_image_url | constrain: '1000'}}
produces a URL of:
path_to_image.jpg?h=0&w=1000
which causes an error a 402 error and a missing image in the browser. The correct path should return as:
path_to_image.jpg?w=1000
I added in a case statement in to deal with this but I'm not very familiar with ruby so I'm sure there's a more elegant solution.
The "constrain" filter seems to break when only one dimension is provided like used in the "Nova" Big Cartel theme. For example:
{{ image | product_image_url | constrain: '1000'}}
produces a URL of:which causes an error a 402 error and a missing image in the browser. The correct path should return as:
I added in a case statement in to deal with this but I'm not very familiar with ruby so I'm sure there's a more elegant solution.