Git Product home page Git Product logo

Comments (3)

vickychijwani avatar vickychijwani commented on May 19, 2024

Same issue here. I ended up getting rid of the firesize and using a pure CSS solution for center-cropping, described here on StackOverflow (the 2nd one). Note that you need to add background-size: cover; to the .center-cropped CSS for it to work correctly. You can see it working correctly on my blog. So we end up with:

// partials/loop.hbs
function homepagePostThumbnail (imgUrl) {
    thumbnailContainer.innerHTML = '<div class="center-crop" style="background-image: url(\'' + imgUrl + '\')">'
        + '<img src="'+imgUrl+'" height="150" alt="{{title}}" /></div>';
}
/* assets/css/main.css */
.post-thumbnail .center-crop {                                                                                                                       
  max-width: 250px;                                                                                                                                  
  height: 150px;                                                                                                                                     
  background-position: center center;                                                                                                                
  background-repeat: no-repeat;                                                                                                                      
  background-size: cover;                                                                                                                            
  overflow: hidden;                                                                                                                                  
}                                                                                                                                                    

/* Set the image to fill its parent and make transparent */                                                                                          
.post-thumbnail .center-crop img {                                                                                                                   
  min-height: 100%;                                                                                                                                  
  min-width: 100%;                                                                                                                                   
  /* IE 8 */                                                                                                                                         
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";                                                                                  
  /* IE 5-7 */                                                                                                                                       
  filter: alpha(opacity=0);                                                                                                                          
  /* modern browsers */                                                                                                                              
  opacity: 0;                                                                                                                                        
}                                                                                                                                                    

This workaround is obviously trading-off some bandwidth and page load speed but I can live with that.

from mnml-ghost-theme.

curiositry avatar curiositry commented on May 19, 2024

Thanks for the heads up @tewen and @vickychijwani — I should have seen this coming when Assembly folded, since Firesize wasn’t profitable yet.

There aren’t any good hosted alternatives for Firesize, so for now I’ve just commented out that part and added a 160px max-height. I hope to find another on-the-fly image resizing API, or host my own, soon — or else go for a solution like Vicky’s.

Sorry for the outage :)

P.S. For anyone who’s hosting on Heroku, it seems if you push an updated theme without updating the theme's version number in package.json, it won’t change; took me a few pushes to figure this out, but I’ve bumped the version number so here so it shouldn’t be a problem.

from mnml-ghost-theme.

tewen avatar tewen commented on May 19, 2024

@curiositry Thanks so much. Love the responsivity. You guys are doing great stuff.

from mnml-ghost-theme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.