Displaying 19 results from an estimated 19 matches for "to_blob".
Did you mean:
ls_blob
2007 Apr 09
6
gruff send_data
Hi,
for those with experience of Gruff module: suppose I want to send
image from server straight to the browser (as example on gruff web
site):
send_data(g.to_blob,
:disposition => ''inline'',
:type => ''image/png'',
:filename => "gruff.png")
the server seems sending this binary data ok, but I am having trouble
to display it properly:
I have tried
<%= link_to_image &...
2006 Jan 09
6
Rendering dynamic Gruff image (send_data)
Dears,
Got a controller witch do a send_data for displaying a chart.
like :
send_data(g.to_blob, :filename => "any.png", :type => ''image/png'',
:disposition=> ''inline'')
I actually do a
<img src="http://myhost:3000/stats/make_graph" />
Is there any way more clean to do that ? At minima don''t hardcode the
beginnin...
2007 May 16
2
RMagick Setting Quality or Compression
I am trying to dynamically set the compression or quality of an image
when displaying it. I have seen in the RMagick documentation how to
set the quality only when writing the file to disk. How can I set the
quality dynamically or set the compression?
The method "image.quality=" does not exist and
"image.compression_type=" is not in the documentation. I have tried
2006 May 25
2
Have a quick Gruff Graphing question
...this (with the labels and data array
populated elsewhere):
g = Gruff::Bar.new(750)
g.title = "12 Month Graph"
g.labels = title_array.reverse
g.theme_37signals
g.data("12 month graph", data.reverse, ''#378CDF'')
send_data(g.to_blob, :disposition => ''inline'', :type =>
''image/png'', :filename => "twelve_month_graph.png")
Thanks for any help.
--
Posted via http://www.ruby-forum.com/.
2009 Dec 24
2
Showing graphs on browser with gruff lib.
Hi,
I am using "gruff" lib for creating the graphs.
I have got the success to create the graph, but my problem is I don''t
want to store it, I want that they should be displyed on the browser it
self.
I have tried this:-
"
send_data(g.to_blob, :disposition => ''inline'', :type => ''image/png'',
:filename => "arbitaryfilename.png") "
By using this it just shows that graph.
I want to show the 5 graphs a a time.
Like:- as objects
I am going to create an object of the grohpa created...
2006 Jan 05
5
File_column crashing WEBrick when using :magick options
I''m trying to use file_column in an app I''m writing. Simple file uploads
are working fine.
However, when I try and use the :magick options to make resized
versions, WEBrick dies.
This is the Media model:
class Media < ActiveRecord::Base
file_column :media_item,
:magick => {
:versions => {
:thumb => {:size =>
2008 Dec 04
2
Does animated gif will work properly using RMagick?
...ere is my code to read and write image while uploading.
image = params[:image][:blob]
image1=params[:image][:blob].original_filename
imgs = Magick::Image.from_blob(image.read)
img = imgs.first
File.open(RAILS_ROOT + "/public/images/banner/" + image1 , "wb") do |f|
f.write(img.to_blob)
end
could anyone suggest me to solve this issue
Thanks in advance,
Regards,
Jose Martin
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" gr...
2006 Jul 22
7
Validation with has_many
I have two problems. I have a comment that has_many uploads. Before
saving the comment, I want to be sure that the upload(s) has passed
validation, but I also need to validate in other ways. For example, I
do not want to save the comment if there is no comment or upload. Or, I
do not want to save the comment if the image has been uploaded
previously (comparing md5s with past upload md5s
2006 Jul 05
1
Need some Gruff graphing help - custom dimensions?
...I''d like 500 width
and 300 height
g.title = "Samplegraph"
g.labels = {1 => "Today", 3 => "Yesterday", 6 => "The Day Before"}
g.theme_37signals
g.data("Graph", data, ''#378CDF'')
g.maximum_value = 10
send_data(g.to_blob, :disposition => ''inline'', :type => ''image/png'',
:filename => "sample_graph.png
--
Posted via http://www.ruby-forum.com/.
2006 Jul 25
1
How do I validate using associated objects?
...create_image
before_create :create_thumbnail
def create_image
@image = Magick::ImageList.new.from_blob(@upload_blob)
self[:image_width] = @image.columns
self[:image_height] = @image.rows
end
def create_thumbnail
@thumbnail = Magick::ImageList.new.from_blob(@image[0].to_blob)
if comment.parent_id == nil
x = comment.board.setting(:parent_thumbnail_at_width)
y = comment.board.setting(:parent_thumbnail_at_height)
else
x = comment.board.setting(:reply_thumbnail_at_width)
y = comment.board.setting(:reply_thumbnail_at_height)
end
if...
2006 Jun 05
1
Strange problem with Gruff not always displaying graph
...> [
"report_context = ''Required''" ] )
for report_items in @records
report_number << report_item.amount.to_i
labels << report_item.date
end
g.data("Reports", report_number)
g.labels = labels
send_data(g.to_blob,
:disposition => ''inline'',
:type => ''image/png'',
:filename => "report_img.png")
end
Then, in the view, I have the following:
<%= image_tag url_for(:controller => ''reports'', :action =>
''create_...
2006 May 17
0
send_data not working properly with link_remote_to
...ot;flip"}
)%>
<div id="img"></div>
controller:
def flip
filename="/public/picture/filename/1/scaler_1.jpg"
img=File.read(filename)
ilist = Magick::ImageList.new
@picture=ilist.from_blob(img)
@picthumb=@picture.flip!
@out=@picthumb.to_blob
send_data(@out,:filename =>''workshopimage'', :type => "image/png",
:disposition => "inline")
end
the above doesnt work
but with my view as
<%= link_to("flip",
:action => "flip"
)%>
it works....so doesnt it me...
2006 Apr 06
1
Rmagick file conversion
I am using rmagick to convert files stored as a tiff to either pdf or
jpg for display to the user. A snippet of test code from the controller
follows. It works OK. ( it does need a sanitizer )
require RMagick
def pdf
@sdoc = Sdoc.find(params[:id])
@fname = ''/var/www/images/'' + @sdoc.fname
@nf = Magick::ImageList.new(@fname)
2006 Apr 14
0
Gruff on Windows
...g.data("Oranges", [4, 8, 7, 9, 8, 9])
g.data("Watermelon", [2, 3, 1, 5, 6, 8])
g.data("Peaches", [9, 9, 10, 8, 7, 9])
g.labels = {0 => ''2003'', 2 => ''2004'', 4 => ''2005''}
send_data(g.to_blob,
:disposition => ''inline'',
:type => ''image/png'',
:filename => "chart.png")
Firstly, does this code look right for a controller method? Secondly, should
this work at all on Windows? In a separate rhtml page i...
2006 Apr 22
1
Gruff
...crumpets_to_date << Crumpets.count("created_on <
''#{date_sql_string}''").to_i
labels[days-day] = date_stamp.strftime("%b %d") if day % 3 == 0
end
g.data("Crumpets Sold", crumpets_to_date)
g.labels = labels
send_data(g.to_blob, :disposition => ''inline'', :type =>
''image/png'', :filename => "crumpets_over_time.png")
end
How do i display this graph in the view???
<img src="/blog/crumpetchartaction"/>
--
Posted via http://www.ruby-forum.com/.
2006 May 30
1
Can''t read from file field second time around
...uot;lg"
img.strip!.change_geometry("640x480>") { |cols, rows, img|
img.resize!(cols, rows) }
else
raise "Unknown image type ''#{self.image_type}''"
end
self.width = img.columns
self.height = img.rows
self.image = img.to_blob
img = nil
GC.start
end
What stupidity have I done here?
Thanks,
Matt.
2005 Oct 11
8
resize images
Hi,
I am looking for the best solution to resize images to fit within a
certain area. The images will only be made smaller if they will not
fit within a fixed size area. It is important to maintain the same
proportions.
This ImageMagick extension looks promising:
http://vantulder.net/rails/magick/
However, I believe it may be overkill for just resizing images
sometimes. I have also seen a
2006 Apr 27
7
SuperImage plugin
Greetings all,
This is the first release of the SuperImage plugin. The idea is you
upload images to the database, and then pull them out at any size you
want. Combine this with caching and it will stay light and fast.
More info and instructions are here:
http://beautifulpixel.textdriven.com/articles/2006/04/27/superimage-plugin-making-resizeable-uploaded-images-easy
svn:
2006 May 19
9
Resize uploaded image file without creating temp file?
Hi,
I need to take a single uploaded image file and save three resized
versions of it, a thumbnail, normal and large version. I was planning on
doing this in my model by having an array of geometry strings and looping
through them, each time saving a new image object resized to the correct
geometry. I know that file column does similar stuff, but I would prefer
to have a separate database row