Displaying 20 results from an estimated 200 matches similar to: "Can''t read from file field second time around"
2007 Apr 19
2
invalid geometry string in change_geometry
I get the following error at the browser:
ArgumentError in ImagesController#upload
invalid geometry string `110×''
... for the call to change_geometry with an explicit size (''110x'') as
the geometry string:
def make_thumb (the_img)
require ''RMagick''
size = "110x"
debugger if ENV[''RAILS_ENV''] ==
2006 Jul 25
1
How do I validate using associated objects?
This doesn''t make any sense to me anymore. I have an Upload that
belongs_to a Comment. Within my Upload model I expect to be able to
access the associated comment with comment.foo. I can only seem to do
this AFTER validation. I''m assuming before_create takes place between
validation and updating the database, because when I try to access
comment.foo within the validate
2006 Mar 30
5
Heeelp - no idea what''s going wrong.
I''m working on a simple CMS. The main data type are "listings" a listing
habtm (has_and_belongs_to_many) categories and subcategories.
Subcategories belong_to categories. Subcategories are basically the same
as categories, but they are treated differently in a few situations.
The problem is, I can''t seem to write the view/controller/model code
that allows me to
2006 Jun 26
4
has_many :through
first, the models:
class Listing < ActiveRecord::Base
has_many :keyword_links
has_many :keywords, :through => :keyword_links, :conditions => "active =
1"
end
class Keyword < ActiveRecord::Base
has_many :keyword_links
has_many :listings, :through => :keyword_links, :conditions => "active =
1"
end
class KeywordLink < ActiveRecord::Base
belongs_to
2006 Sep 03
7
using polymorphic associations with acts_as_list
This is what I have
class Photo < ActiveRecord::Base
belongs_to :image, :polymorphic => true
acts_as_list :scope => image
end
class Place < ActiveRecord::Base
has_many :photos, :as => :image
end
class Child < ActiveRecord::Base
has_many :photos, :as => :image
end
I want to be able to reorder the images. What I need is for the
position of the photos to be set
2006 Aug 15
0
file object treated as a string
I am trying to implement the uploading of a file to a remote server
My upload form looks like this:
<%= start_form_tag(:action => "save_image", :multipart => true) %>
<td><b>Description</b> </td>
<td><%= text_area("image", "descript", "cols" => 33, "rows" => 5) %></td>
2006 Mar 23
0
Reading image file field data directly into RMagick
I''m trying to read image data from an upload file field directly into
an RMagick image object without having to temporally save the image
file first. Assuming my file field param is assigned to @temp_file, i
tried RMagicks from_blob method:
img = Magick::Image::from_blob(@temp_file.read)
But i get an error message saying that the blob is empty. I also
tried feeding it the entire
2006 May 16
0
Image format gotcha
I''ve been doing a lot of testing witn RMagick lately, in view of reports
that it leaks memory. I''m happy to report that RMagick doesn''t seem to
leak at all, when used as directed -- that is, when you remember to set
the image variable to nil and call GC.start manually after you''re done
with an image.
BUT -- one ImageMagick format seems to be leaky! I was
2006 Mar 05
2
How to clean up this code?
Hi!
I''ve got 2 tables: products and images. Product has_many images, image
belongs_to product. In images table i store product_id and name of the
image (not the image itself).
I''ve created a single form, where user can add any number of images for
a
product he/she is creating (new fields are created using javascript).
The images that are uploaded are saved to public/images
2006 Apr 24
0
ImageMagick and EXIF Data
Hi there,
I''m writing a little application that parses an image file and extracts the
camera settings from the file (the EXIF data) and saves all the fields to
the database. The idea is that after awhile people will be able to search
based on camera make, model, lens settings, etc... and all the pictures that
meet those requirements will be displayed. The picture is stored on the file
2006 Aug 15
8
AGAIN: file object treated as string
I am trying to implement the uploading of a file to a remote server
I get error while trying to write the file on the server. The error I
get is the following:
undefined method `rewind'' for #<String:0x2aaaad062eb8>
It seems to be treating my file as a string instead of a File object.
--------- Code is below ------------------
VIEW:
<%=
2015 Oct 21
0
Bug#753358:
I can confirm that I'm also seeing this issue with DRBD backed block
devices. A test dom0 pair that I've just dist upgraded from Wheezy to
Jessie is no longer able to boot any domUs via pygrub. As a test I've just
pulled pygrub out of xen-tools-4.5 from experimental but I'm still getting
the same error in the bootloader.log:
----
Traceback (most recent call last):
File
2008 Dec 04
2
Does animated gif will work properly using RMagick?
Dear all,
I have used RMagic to read and write a image while uploading. An
animated gif was read from my local machine and was written in my images
folder using RMagick. But the animated gif which i read was witten in my
folder without animation. What should i do to write the gif image with
animation.
Here is my code to read and write image while uploading.
image = params[:image][:blob]
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
2008 Jan 22
4
Calling a function
Hi. I''m trying to call the function ''store_description(image)'' at line
9. However when I do, I get the error "undefined method
''store_description'' for Photo:Class". What can I do?
1: class Photo < ActiveRecord::Base
2: def store_description (image)
3: self.description = "size:
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 May 10
0
Saving extracted data
Hi there,
I have a file upload form on my page that is for images. In the model I have
this:
def file_data=(file_data)
@file_data = file_data
write_attribute ''extension'',
file_data.original_filename.split(''.'').last.downcase
write_attribute("content_type", file_data.content_type)
write_attribute("current_name",
2006 May 17
0
send_data not working properly with link_remote_to
I''m reading an image in an link_to_remote call,and then using send_data
i send the read image as :type => "image/png" :disposition =>
"inline"...but when the div tag gets updated i see only ascii characters
.....but if i do the same operation using normal call(link_to) i see it
functioning normal ....could someone explain .
my view:
<%=
2012 Jul 19
2
[PATCH] pygrub: add syslog support to pygrub
# HG changeset patch
# User Zhigang Wang <zhigang.x.wang@oracle.com>
# Date 1342720736 14400
# Node ID ec9655b30a5fa5b5abb3e05505f681f9be559613
# Parent 43e21ce7f22151524b800a6cf0ac4ba1233b34a7
pygrub: add syslog support to pygrub
Currently, when pygrub failed, we don''t know the reason because xend/xl will
not capture the stderr message.
This patch will log the error message to
2006 Feb 25
5
MySQL client ran out of memory
I''m getting the following error unexpectedly for my rails app. I just
exported the databae from dreamhost and imported it on textdrive for
my rails app.
Mysql::Error: MySQL client ran out of memory: SELECT COUNT(*) FROM
comments WHERE (comments.listing_id = 2666)
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract_adapter.rb:88:in