2009-10-06 8 views
0

attachment_fu génère un nom de fichier public incorrect.rails attachment_fu public_filename problème

 
>> pic.thumbnails 
=> ProductPicture id: 12331, product_id: nil, parent_id: 12330, content_type: "image/png", filename: "b_9788994035109_mid.png", thumbnail: "mid", size: 16562, width: 205, height: 205, created_at: "2009-10-05 02:43:50", updated_at: "2009-10-05 02:43:50", 
ProductPicture id: 12332, product_id: nil, parent_id: 12330, content_type: "image/png", filename: "b_9788994035109_thumb.png", thumbnail: "thumb", size: 2300, width: 52, height: 52, created_at: "2009-10-05 02:43:51", updated_at: "2009-10-05 02:43:51" 
>> pic 
ProductPicture id: 12330, product_id: 23236, parent_id: nil, content_type: "image/gif", filename: "b_9788994035109.gif", thumbnail: nil, size: 73990, width: 400, height: 400, created_at: "2009-10-05 02:43:50", updated_at: "2009-10-05 02:43:50" 
>> pic.thumbnails 
=> ProductPicture id: 12331, product_id: nil, parent_id: 12330, content_type: "image/png", filename: "b_9788994035109_mid.png", thumbnail: "mid", size: 16562, width: 205, height: 205, created_at: "2009-10-05 02:43:50", updated_at: "2009-10-05 02:43:50", ProductPicture id: 12332, product_id: nil, parent_id: 12330, content_type: "image/png", filename: "b_9788994035109_thumb.png", thumbnail: "thumb", size: 2300, width: 52, height: 52, created_at: "2009-10-05 02:43:51", updated_at: "2009-10-05 02:43:51" 
>> pic.public_filename 
=> "/product_pictures/0001/2330/b_9788994035109.gif" 
>> pic.public_filename(:mid) 
=> "/product_pictures/0001/2330/b_9788994035109_mid.gif" 

Il génère ".gif" au lieu de ".png" lorsque le type réel est '.png' (gif est le type de parent)

Cela fonctionne bien avec ma machine dev mais pas avec mon machine de production.

Une idée?

Merci.

Sam

Répondre

0

Je l'ai compris.

Je n'ai pas spécifié: processor dans attachment_fu et utilise n'importe quel processeur installé. Ma machine de développement a ImageScience et RMagick et ma machine de production n'avait que RMagick. ImageScience redimensionne gif en png car il ne peut pas très bien gérer gif.