Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
Mikael Muszynski
I don't remember the last time we had a PR with a green build.
Although that might have to do more with me not inspecting every PR.
Ilya Vassilevsky
Agreed. It's mostly newer versions of ImageMagick. They broke some stuff it seems.
hi guys is there a simple set up guide for rmagick on rails (for a beginner)
Tom von Schwerdtner
Specific question. Is anyone familiar with ImageList core dumps when using rmagick on RHEL 6.5 with ImageMagick and GraphicsMagick installed?
Maybe I can come up with a travis config to reproduce
This message was deleted
Hi, I trying using Rmagick.
I create image avatar default with Rmagick.
When I finishing create avatar default. I don't know the way to save it into database.
Currently, I use carrierwave to upload
This is my code
def draw_image(user_name)
    img = Magick::Image.new(96, 96){self.background_color = 'white'}
    name = user_name.split(" ")
    name = name[0][0] + name[-1][0]
    txt = Draw.new
    # img.annotate(img, width, height, x, y, text)
    img.annotate(txt, 0, 0, 0, 35, name){
      txt.gravity = Magick::SouthGravity
      txt.pointsize = 26
      txt.fill = '#3D3D3D'
      txt.font_weight = Magick::BoldWeight
    img.format = 'jpeg'
    send_data img.to_blob, :stream => 'false', :filename => 'avatar-default.jpg', :type => 'image/jpeg', :disposition => 'inline'
def create
    user_name = _user_params[:name]
    if _user_params[:avatar].to_s.empty?
      _user_params[:avatar] = draw_image(user_name)
    user = User.create!(_user_params)
    render json: {status: user}, root: false
@/all : are you there?
Victor Justo V.
Victor Justo V.
I am using rmagick to convert the pages from a pdf to png, for that im calling to_blob, this returns a huge blob string, that somehow errors out while trying to pass it as an argument to a sidekiq worker. Im getting Encoding::UndefinedConversionError: "\x89" from ASCII-8BIT to UTF-8
Tom von Schwerdtner
I forgot I was even in this room...
@vjustov You’re passing the blob to sidekiq?
Victor Justo V.
yes, in order to upload it to s3 on a different worker.
when sidekiq is trying to serialize the parameters to json, it errors out with said message
Tom von Schwerdtner
I am not a redis expert but I’d be leery of shoving a bunch of data into the queue, would it be possible to write to a short-term file and to pass the file path to the next job?
I mean, I trust redis. But if you can just cache that data on the filesystem that seems more reliable than putting it into the queue.
(Apologies for totally sidestepping your question)
You could also jeck the sidekiq gitter room, though it is infrequently used. It seems like something is trying to convert your blob for whatever reason. Possibly for storage in redis...
Victor Justo V.
hmm, im gonna go and do that, meanwhile is the encoding of the blob really ascii-8?
Tom von Schwerdtner
I don’t know, it seems like it might be more about what sidekiq expects than what rmagick produces.
Victor Justo V.
hmm interesting
now im doing this: t = Tempfile.new('pdf.page.image').write(blob) and i get the same error
Tom von Schwerdtner
Are you passing the temp file or the path?
Also, a temp file lives with its process, it may not be around when the other job kicks off.
Victor Justo V.
i was passing the path, but what i meant was that i was also getting the error when calling #write with the blob, no sidekiq involved there.
i am trying to isolate and reproduce the behavior.
Tom von Schwerdtner
ahh, gotcha
Ryan Hass
I am trying to just display an image, but when I do nothing actually is displayed. Instead I get this: pry(main)> i = Magick::Image.from_blob(IO.read('/tmp/test.jpg')) ; pid = fork { i.display } ; Process.detach(pid) [ JPEG 2000x1050 2000x1050+0+0 DirectClass 8-bit 266kb]=> #<Thread:0x00000001b18450 sleep>
Any ideas why the image doesn't actually get displayed?
Ryan Hass
Process.waitpid does essentially the same thing as well
[ JPEG 2000x1050 2000x1050+0+0 DirectClass 8-bit 266kb]=> 734
Trung Lê
i think you should ask on StackOverflow, the chat room is pretty dormant atm
Alexandre ZANNI
I have a big array [ [1, 1, 1], [1, 1, 1], [1, 1, 1] ... ] that are RGB pixels and I want to convert it to an image. Is it possible with Rmagick ?
Mischa Molhoek
Hi there everyone
@noraj1337 , it think your would have to use the array pack command in some way for that
Ramesh Choudhary
Need your support guys