Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug - wallpapers aren't placed correctly in saved image #2746

Closed
owocki opened this issue Nov 9, 2018 · 13 comments
Closed

bug - wallpapers aren't placed correctly in saved image #2746

owocki opened this issue Nov 9, 2018 · 13 comments
Labels
bug This is something that isn't working as intended.

Comments

@owocki
Copy link
Contributor

owocki commented Nov 9, 2018

see this screencast:

screen recording 2018-11-09 at 10 49 am

acceptance criteria:

  • fix this bug
@owocki
Copy link
Contributor Author

owocki commented Nov 9, 2018

@Dgilliams @kuhnchris any interest in this one? if not, ill bounty it

@kuhnchris
Copy link
Contributor

Sure, but, @owocki i noticed this during development: this is very hard depending on the view port set on the new background. Is this one of the new ones?

@gitcoinbot
Copy link
Member

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 0.3 ETH (63.27 USD @ $210.89/ETH) attached to it.

@gitcoinbot
Copy link
Member

gitcoinbot commented Nov 9, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 8 months from now.
Please review their action plans below:

1) kuhnchris has started work.

Analyzing the viewport / issue with the background

Learn more on the Gitcoin Issue Details page.

@PixelantDesign PixelantDesign added bug This is something that isn't working as intended. Gitcoin Avatar Builder labels Nov 12, 2018
@owocki
Copy link
Contributor Author

owocki commented Nov 14, 2018

@kuhnchris having any luck? or are you still blocked by docker stuff..

@kuhnchris
Copy link
Contributor

yes and yes, I'll try to setup a local docker now if that works...

thelostone-mc added a commit that referenced this issue Nov 19, 2018
#2746 - Wallpapers being not centered and too small
@gitcoinbot
Copy link
Member

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 0.3 ETH (39.93 USD @ $133.1/ETH) has been submitted by:

  1. @kuhnchris

@owocki please take a look at the submitted work:


@gitcoinbot
Copy link
Member

⚡️ A *Always Shipping* Kudos has been sent to @kuhnchris for this issue from @owocki. ⚡️

Nice work @kuhnchris!
Your Kudos has automatically been sent in the ETH address we have on file.

@gitcoinbot
Copy link
Member

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 0.3 ETH (33.71 USD @ $112.37/ETH) attached to this issue has been approved & issued to @kuhnchris.

@owocki
Copy link
Contributor Author

owocki commented Nov 26, 2018

hey @kuhnchris i'm seeing this on the new mask feature that was developed... see https://c.gitcoin.co/avatars/dc4a2fb8fee84af6492f66e068d192d7/owocki.svg

any chance your fix for wallpapers could apply to the mask feature? will happily tip if so

@kuhnchris
Copy link
Contributor

Most likely this should work. It depends on how the mask is sized. If the mask-feature is live I can take a look at the test instance if you want.

@kuhnchris
Copy link
Contributor

Just tested - after a couple of adaption also I can be a kawaii anime girl
image
And regarding spongebob's starfish face man:
image

diff --git a/app/avatar/utils.py b/app/avatar/utils.py
index 7ef066a7a..f0dcffbdc 100644
--- a/app/avatar/utils.py
+++ b/app/avatar/utils.py
@@ -246,22 +246,29 @@ def build_avatar_component(path, icon_size=None, avatar_size=None):
     scale_factor = icon_size[1] / avatar_component_size[1]
     x_to_center = (icon_size[0] / 2) - ((avatar_component_size[0] * scale_factor) / 2)
     svg = SVG(f'{COMPONENT_BASE}{path}')
-    if path.startswith('Wallpaper'):
+    if path.startswith('Wallpaper') or path.startswith('Makeup'):
         src = transform.fromfile(f'{COMPONENT_BASE}{path}')
-
+
         #       TODO: Consider width aswell...
-        #        if src.width != None:
-        #            src_width = float(re.sub('[^0-9]','', src.width))
-        #        else:
-        #            src_width = 900
+        if src.width is not None:
+            src_width = float(re.sub('[^0-9]','', src.width))
+        else:
+            src_width = 900

         if src.height is not None:
             src_height = float(re.sub('[^0-9]', '', src.height))
         else:
             src_height = 1415
         scale_factor = icon_size[1] / src_height
+        if path.startswith('Makeup'):
+            scale_factor = scale_factor / 2
+
         svg = svg.scale(scale_factor)
-    if not path.startswith('Wallpaper'):
+        if path.startswith('Makeup'):
+            x_to_center = (icon_size[0] / 2) - ((src_width * scale_factor) / 2)
+            svg = svg.move(x_to_center, src_height * scale_factor / 2)
+
+    if not path.startswith('Wallpaper') and not path.startswith('Makeup'):
         svg = svg.scale(scale_factor)
         svg = svg.move(x_to_center, 0)
     return svg

@owocki
Copy link
Contributor Author

owocki commented Nov 27, 2018

thanks @kuhnchris -- mind submitting a PR with that patch?

owocki added a commit that referenced this issue Nov 30, 2018
Fix #2746 - Makeup causing issues aswell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is something that isn't working as intended.
Projects
None yet
Development

No branches or pull requests

4 participants