Announcement

Collapse
No announcement yet.

Reload Avatar Scheduled Task?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reload Avatar Scheduled Task?

    Hi,

    I am trying to make a scheduled task that rebuilds the avatar thumbnails, due to a workaround to make avatars larger in the postbit, however this ends up making fresh avatars look badly compressed.

    I don't really understand how to write a Scheduled Task, and I have no idea where to start. So any help would be appreciated!

  • #2
    There really is no reason to rebuild these with a scheduled task. The "postbit" uses the full size avatar and resizes it via CSS. If your avatars look malformed, then you should check your custom CSS and make sure that the avatar is squared properly.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud customization and demonstration site.
    vBulletin 5 Documentation - Updated every Friday. Report issues here.
    vBulletin 5 API - Full / Mobile
    I am not currently available for vB Messenger Chats.

    Comment


    • #3
      It's this in css_additional.css

      /* start custom avatar size */

      .l-col__flex-3, .l-row__fixed--left > .l-col__flex-3 {
      margin-left: 240px!important;
      }
      .b-userinfo__details {
      width: 240px;
      margin-left: -20px;
      }
      .l-desktop .b-userinfo {
      width: 210px;
      }
      .b-avatar--m {
      height: 150px!important;
      width: 150px!important;
      }

      .b-avatar--m > img {
      max-height: 150px!important;
      max-width: 150px !important;
      height: 150px!important;
      width: 150px!important;
      }
      media only screen and (max-width: 783px) {
      .l-col__flex-3, .l-row__fixed--left > .l-col__flex-3 {
      margin-left:0px!important;
      float:none!important;
      }
      .b-userinfo__details {
      margin-left: 0;
      display:none;
      }

      .b-avatar--m {
      height: 150px!important;
      width: 150px!important;
      }

      .b-avatar--m > img {
      max-height: 150px!important;
      max-width: 150px !important;
      height: 150px!important;
      width: 150px!important;
      }}

      Comment


      • #4
        You should make sure to set both the height and width on images. Even then, non-square images may be deformed by this.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud customization and demonstration site.
        vBulletin 5 Documentation - Updated every Friday. Report issues here.
        vBulletin 5 API - Full / Mobile
        I am not currently available for vB Messenger Chats.

        Comment


        • #5
          Not quite sure I follow, the height and width are both set from what is written there from what I can tell, unless I am missing something. Sorry, very new to this!

          Comment


          • #6
            This is the only valid line that changes sizes:

            Code:
            max-width: 150px !important;
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud customization and demonstration site.
            vBulletin 5 Documentation - Updated every Friday. Report issues here.
            vBulletin 5 API - Full / Mobile
            I am not currently available for vB Messenger Chats.

            Comment


            • #7
              So max height isn't doing anything useful? I'm not quite sure what is going on, the size is working fine on the thread, it's just the image looks garbage after being uploaded, attached image shows all this.



              1: Uploaded image to profile, crop it, looks nice on the profile.
              2: In the postbit, it is at 150x150 size, but the quality is awful.
              3: Right click to see the thumbnail, which has generated at a small size, so resized upwards through CSS.
              4: Rebuild Thumbnails in ACP.
              5: Now looks nice on a thread.
              6: Thumbnail is at the size I wanted in the first place.

              So what is making the thumbnail initially upload so small?

              Comment


              • #8
                Originally posted by Slowmin View Post
                So what is making the thumbnail initially upload so small?
                It might be Message Attachment Options / Attachment Resize Options in the AdminCP which sets the default thumbnail size to 121px. You can change that to "0" to have it default to the actual image size.

                Comment


                • #9
                  Originally posted by In Omnibus View Post

                  It might be Message Attachment Options / Attachment Resize Options in the AdminCP which sets the default thumbnail size to 121px. You can change that to "0" to have it default to the actual image size.
                  Seems like a good shout, but it's not that, the avatar thumbnail it's making is going to 100 x 100, so none of the options in the Attachment Resize match that, I tried changing Thumbnail to 150px and to 0px, didn't do anything. Tried with some of the others too.

                  Comment


                  • #10
                    Being on an iPad at the moment I don't have access to the files but I am sure there are avatar dimensions hard coded in core/includes/class_core.php.

                    I recall these having to be edited at one time relating to a bug whereby avatars didn't resize on page 2 and onwards in a thread. However that bug was later fixed. I don't know if editing that value might help here. It might be worth a test. Ensure you back up the file first.
                    MARK.B | vBULLETIN SUPPORT

                    TalkNewsUK - My vBulletin 5.5.2 Demo
                    AdminAmmo - My Cloud Demo

                    Comment


                    • #11
                      Yep, that's already done here:

                      Code:
                      define('FIXED_SIZE_AVATAR_WIDTH',  150);
                      define('FIXED_SIZE_AVATAR_HEIGHT', 150);
                      The avatars are displaying at those settings, the problem is that the thumbnail generated when it's uploaded is going to 100 x 100, if I rebuild avatar thumbnails, it goes to 150 x 150

                      Comment


                      • #12
                        Originally posted by Slowmin View Post
                        So max height isn't doing anything useful? I'm not quite sure what is going on, the size is working fine on the thread, it's just the image looks garbage after being uploaded, attached image shows all this.
                        You're missing the space between px and !important. This will cause parsing errors in the CSS.

                        Is your thumbnail size set to 150 under Settings -> Options -> Message Attachment Options? Avatars are treated the same as attachments.
                        Translations provided by Google.

                        Wayne Luke
                        The Rabid Badger - a vBulletin Cloud customization and demonstration site.
                        vBulletin 5 Documentation - Updated every Friday. Report issues here.
                        vBulletin 5 API - Full / Mobile
                        I am not currently available for vB Messenger Chats.

                        Comment


                        • #13
                          Originally posted by Wayne Luke View Post
                          Is your thumbnail size set to 150 under Settings -> Options -> Message Attachment Options? Avatars are treated the same as attachments.
                          Yep, but it's not doing anything, the image thumbnail that is generated after uploading is still displaying at 100 x 100, is there something that hardcodes the avatar thumbnails when they get uploaded? Because rebuilding the avatar thumbnails makes them 150 x 150, yet when first uploaded, they get shrunk.

                          Comment


                          • #14
                            It is probably hardcoded. The system wasn't designed to change the size of the Avatars. Many design decisions are focused on specific avatar sizes at specific locations. Where it is hardcoded, I don't know. I haven't looked through code to find avatar sizes. Probably in the library code that deals with user profiles and avatars.

                            Probably easier to edit the avatar template so it only uses the full size image. Though I haven't dissected that template either.
                            Translations provided by Google.

                            Wayne Luke
                            The Rabid Badger - a vBulletin Cloud customization and demonstration site.
                            vBulletin 5 Documentation - Updated every Friday. Report issues here.
                            vBulletin 5 API - Full / Mobile
                            I am not currently available for vB Messenger Chats.

                            Comment


                            • #15
                              I wouldn't even know where to begin with that! It certainly seems like something between the upload input and the avatar though, because as I say, when the avatar thumbnails are rebuilt, it goes to 150 x 150.

                              Comment

                              Related Topics

                              Collapse

                              Working...
                              X