Git Product home page Git Product logo

Comments (8)

jnicklas avatar jnicklas commented on July 18, 2024

Are you sure you're not converting to another format?

from refile-mini_magick.

richardvenneman avatar richardvenneman commented on July 18, 2024

I can confirm that uploaded transparent PNG's lose their transparency to a white background on Refile 0.6.1

from refile-mini_magick.

janko avatar janko commented on July 18, 2024

Is the MiniMagick version the same? Maybe while updating Refile you also updated MiniMagick (Bundler would do that automatically for you).

from refile-mini_magick.

richardvenneman avatar richardvenneman commented on July 18, 2024

That could surely be the case.

Gemfile.lock:

mini_magick (4.3.3)
refile (0.6.1)
      mime-types
      rest-client (~> 1.8)
      sinatra (~> 1.4.5)
    refile-fog (0.2.0)
      fog
      refile
    refile-mini_magick (0.2.0)
      mini_magick (~> 4.0)
      refile (~> 0.5)

Please note that I don't have any experience with previous versions of Refile.

from refile-mini_magick.

janko avatar janko commented on July 18, 2024

Could you try to compose a MiniMagick code snippet that reproduces the problem? Just copy paste the code from refile-mini_magick and fill in with specific images. Then we'll know what's the actual and expected outcome and see is the problem in Refile or MiniMagick. Which processing method does this happen on?

from refile-mini_magick.

richardvenneman avatar richardvenneman commented on July 18, 2024

I think I tracked down the problem while setting up a testcase.

The background stays transparent after resizing with this image, mini_magick 4.3.3 and the following snippet:

require 'mini_magick'

image = MiniMagick::Image.open('in.png')
image.resize '50x50'
image.gravity 'Center'
image.write 'out.png'

However, when adding the ImageMagick extent command (as in https://github.com/refile/refile-mini_magick/blob/master/lib/refile/mini_magick.rb#L81), the background of the output image will be white:

image.extent '50x50'

I'm not too comfortable with ImageMagick so I don't now if this is actually the fix and doesn't break any other stuff in the gem. Let me know if I can help in any other way.

from refile-mini_magick.

endorfin avatar endorfin commented on July 18, 2024

I have created a pull request #15 which solves the problem.

from refile-mini_magick.

janko avatar janko commented on July 18, 2024

#15 has been merged, see #15 (comment).

from refile-mini_magick.

Related Issues (15)

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.