attachment_fu not saving other attributes (like width, height)

http://pastie.caboo.se/131759

I'm only getting the basic filename, product_id for the image, and size (kb).

I am *not* getting the thumbnail generated (in db or filesystem), nor is it resizing the image as depicted in the Picture model

id | parent_id | content_type | filename |

thumbnail | size | width | height | product_id |

You probably don't have an image processor installed correctly then.

Could it possibly be the way I'm adding the uploaded image?

@product = Product.find(params[:id])     @product.pictures.build(params[:picture])     if @product.update_attributes(params[:product])       flash[:notice] = 'Product was successfully updated.'       redirect_to :action => 'show', :id => @product     else       render :action => 'edit'     end

I saw some other posts about a bug with attachment_fu and update_attributes. How do I ensure I"ve got the image processor installed properly?

I apologize for jumping the gun. Re-emerging imagemagick and re- installing "gem install rmagick" fixed the problem.

I am unable however to make the case where an image is optional.

I want to require an image on :create, but make it option on :edit/:update

Enclose the image upload in its own form

I was able to get the effect with this line inside the "update" method for ProductController:

@product.pictures.build(params[:picture]) unless params[:picture] [:uploaded_data].blank?

if @product.update_attributes(params[:product]) ... end

When I try to validate height and width in my image model (which is using attachement_fu) it fails validation. Yet when I examine the database, those fields are properly filled in. I've removed the validation for now, yet this bothers me. I guess attachment_fu must have overridden the model save! method but I don't see where this happens. Any clues would be appreciated.

Is there a way to validate that the image processor is installed correctly? I find that generating thumbnails simply hangs, so I've turned that off while I work on other parts of the project.

I'm developing on windows xp and rails 2.0.2. Are there any mods or updates needed for rails 2.0.2?

fredistic

There is a bug I saw people talk about where you need to add a sleep 1, before you load the picture to your model. Try searching this list for "attachment_fu windows bug"