Giter Site home page Giter Site logo

裁剪图片 about image HOT 5 OPEN

billie66 avatar billie66 commented on June 16, 2024
裁剪图片

from image.

Comments (5)

billie66 avatar billie66 commented on June 16, 2024

png 图片背景会被设置为黑色

tapmodo/Jcrop#140

tapmodo/Jcrop#13

from image.

billie66 avatar billie66 commented on June 16, 2024

cropping images on rails4 has some trouble

http://stackoverflow.com/questions/21401445/using-jcrop-with-cloudinary-through-rails-4-to-crop-before-creating-image

主要涉及到 Rails 4 中 strong parameters 功能,裁剪的参数都需要白名单化

from image.

billie66 avatar billie66 commented on June 16, 2024

https://github.com/maxd/jcrop-rails-v2 这个 gem 已经更新到 jcrop 的最新版本,可以使用

from image.

billie66 avatar billie66 commented on June 16, 2024

Jcrop 会把 png 图片背景设为黑色,这是由 Jcrop 的默认选项 bgColor: "black" 控制的,若设置 bgColor 的值为空,则图片背景色保持不变。

$(function(){
  $('#cropbox').Jcrop({
    bgColor: ''
  });
});

另外,png 图片裁剪保存之后仍为 png 格式,图片显示正常,不知用 FileReader 操作之后会不会出状况

from image.

billie66 avatar billie66 commented on June 16, 2024

使用 RMagick or MiniMagick 在裁剪图片时,使用的接口不一样:

https://github.com/kirtithorat/carrierwave-crop/blob/master/lib/carrierwave/crop/model_additions.rb#L84-L90

from image.

Related Issues (10)

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.