Skip to content

Commit

Permalink
new retina images support
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed May 5, 2016
1 parent 8c55a38 commit 57eaab4
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/eadapters/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ class EProduct(base.EBase):
def _build(cls, model, map):
super(EProduct, cls)._build(model, map)
model["value"] = model["name"]
model["thumbnail"] = cls._get_image(model, size = "thumbnail")
model["thumbnail"] = model["thumbnail"] or cls._get_image(
model,
size = "400",
strict = False
)
model["large_image"] = cls._get_image(model, size = "large_image")
model["large_image"] = model["large_image"] or cls._get_image(
model,
size = "1000",
strict = False
)
for name, size in (
("thumbnail", 400),
("thumbnail-2x", 800),
("large_image", 1000),
("large_image-2x", 1000)
):
model[name] = cls._get_image(model, size = name)
model[name] = model[name] or cls._get_image(
model,
size = str(size),
strict = False
)

@classmethod
def _sizes(cls, size):
Expand Down

0 comments on commit 57eaab4

Please sign in to comment.