jyotiverma0310 / burningimage

Automatically exported from code.google.com/p/burningimage
0 stars 0 forks source link

Cannot cast object 'IMAGE_MAGICK' with class 'pl.burningice.plugins.image.engines.RenderingEngine' to class 'pl.burningice.plugins.image.engines.RenderingEngine' #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In config.groovy:
//burning image settings
bi.renderingEngine = RenderingEngine.IMAGE_MAGICK
bi.imageMagickQuality = 50
bi.imageMagickCompression = 50

bi.Product = [
    outputDir: 'images',
    prefix: 'mySuperImage',
    images: ['large': [scale: [width: 800, height: 600, type: ScaleType.APPROXIMATE],
        watermark: [sign: 'images/springsource.png', offset: [top: 10, left: 10]]],
        'small': [scale: [width: 100, height: 100, type: ScaleType.ACCURATE],
            watermark: [sign: 'images/springsource.png', offset: [top: 10, left: 10]]]],
    constraints: [
        nullable: true,
        maxSize: 5000,
        contentType: ['image/gif', 'image/png']
    ]
]
2. Created a domain class com.xxx.domain.Product
import pl.burningice.plugins.image.ast.FileImageContainer

@FileImageContainer(field = 'photo')
class Product {

  String name
  Double price

  static constraints = {
    name(nullable: true)
    price(nullable: true)
    photo(nullable: true, maxSize: 10000000000)
  }
}

3.
Save it
    def productInstance = new Product(params)
    productInstance.save(flush: true)
    imageUploadService.save(productInstance, {image, name, action ->
      if (name == 'large') {
        image.text({it.write("Text on large image", 300, 300)})
      }

      action()

      if (name == 'small') {
        image.text({it.write("Text on small image", 10, 50)})
      }
    })

What is the expected output? What do you see instead?

Got the error:
Error:
URI: /travel2China/grails/product/save.dispatch
Exception Message: Cannot cast object 'IMAGE_MAGICK' with class 
'pl.burningice.plugins.image.engines.RenderingEngine' to class 
'pl.burningice.plugins.image.engines.RenderingEngine'
Caused by: Cannot cast object 'IMAGE_MAGICK' with class 
'pl.burningice.plugins.image.engines.RenderingEngine' to class 
'pl.burningice.plugins.image.engines.RenderingEngine'
Class: ImageUploadService 

What version of the product are you using? On what operating system?
burningimage plugin v0.5 and grails 1.3.2, ubuntu9.10

Please provide any additional information below.

Original issue reported on code.google.com by Ivan.Jia...@gmail.com on 6 Aug 2010 at 1:45

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Can you attach full stacktrace and image that cause error? I tried reproduce it 
but without success. One comment: don't use constraints for field that is used 
to bind image. BI will create it on base of configuration that is provided for 
specified domain class marked by BI annotation.

Original comment by gdula.pawel@gmail.com on 9 Aug 2010 at 9:45

GoogleCodeExporter commented 9 years ago

Original comment by gdula.pawel@gmail.com on 23 Aug 2010 at 10:55