White Space

Martin Kloss martin.kloss at gmx.de
Wed Dec 17 18:32:32 CST 2003


At 18:07 17.12.2003, you wrote:
>I'm using Valentina with Director to produce a product catalog. I have about
>1000 photos stored in the database. They are all the same dimensions with a
>varying amount of white space surrounding the product image. When I bring
>the file into Director using GetPicture, it trims the surrounding white
>space which really screws up the registration of the image.
>
>Is there anyway to get images in and out of the database without the white
>space being trimmed?

Hi Mark,

this is a really, really annoying bug and you have to manipulate your
images after getting them from the database with GetPicture, because
there is no way you can prevent SetPicture from changing your pictures.
This seems only to happen to 32-bit images, though.

It seems like the first pixel column to the left gets appended to the right.
so here's what I do to compensate it, works pretty fast:

    -- strip right pixel column (workaround for V4MD/Jpeg lib Bug)

    -- get image
    myImg = pMem.image.duplicate()
    myWidth = myImg.width
    myHeight = myImg.height

    -- copy right 1-pixel column to the left side
    srcRect = rect(myWidth-1, 0, myWidth, myHeight)
    destRect = rect(-1, 0, 0, myHeight)
    myImg.copyPixels(myImg, destRect, srcRect)

    -- crop right 1-pixel column and set image
    pMem.image = myImg.crop(rect(-1, 0, myWidth-1, myHeight))


Maybe it can help someone.

Martin.


More information about the Valentina mailing list