From: Chris Metcalfe Date: 2008-05-30T03:23:15+09:00 Subject: Ruby .read image upside down? Sorry the above message posted prematurely. The code is as follows: if params[:thumbnail] !=nil && params[:thumbnail] != "" virtual_item.thumbnail = params[:thumbnail].read virtual_item.thumbnail_content_type = params[:thumbnail].content_type.chomp end Now the .read function read the image properly. However it is being stored in the database upside down. The rows of the image are flipped only vertically, which is strange, and not both vertically and horizontally backwards. I'm assuming that there is a some 'header' bytes which describe the image, then the actual pixel data list row by row. We are reading PNG files. The 3D rendering software outputs the images the right side up, but once they have been transfered and saved in the database they are upside down. Any ideas on how we can investigate whether the .read function is doing something strange or prove that truly the params[:thumbnail] parameter actually contains upside down data? -- Posted via http://www.ruby-forum.com/.