Hello.
I'm trying to open and convert a cmyk jpg to a rgb image. Using LCMS2 functions 
I have a strange result... When the row
        if ct.Transform(mi,mo,mi.Size) then
executes, the application crashes, without errors, but simply crashes.
Can you help me to understand what is wrong in this code?

Many thanks!

  dim fin,fout As FolderItem
  dim b As BinaryStream
  dim mi,mo As MemoryBlock
  dim s As String
  dim fi,fo as FolderItem
  dim ct as LCMS2TransformMBS
  dim pi,po as LCMS2ProfileMBS
  dim p As Picture
  
  fo=GetFolderItem("Generic RGB Profile.icc")
  fi=GetFolderItem("Generic CMYK Profile.icc")
  po = LCMS2ProfileMBS.OpenProfileFromFile(fo)
  pi = LCMS2ProfileMBS.OpenProfileFromFile(fi)
  
  fin=GetOpenFolderItem(FileTypesImages.All)
  if fin<>nil then
    b=BinaryStream.Open(fin)
    s=b.Read(b.Length)
    mi=s
    mo=New MemoryBlock(mi.Size) // CMYK
    dim pif as integer = pi.FormatterForColorspace(1, false)
    dim pof as integer = po.FormatterForColorspace(1, false)
    dim flags as integer = LCMS2MBS.kcmsFLAGS_BLACKPOINTCOMPENSATION
    ct = LCMS2TransformMBS.CreateTransform(pi, pif, po, pof, 0, flags)
    if ct.Transform(mi,mo,mi.Size) then
      p=mo.GetPictureMBS("test.jpg",FileTypesImages.Jpeg)
    end if
  end if

------

Sergio Tamborini
Brescia
http://www.system-i.it


"C'è un equivoco di fondo. Si dice che il politico che ha avuto frequentazioni 
mafiose, se non viene giudicato colpevole dalla magistratura, è un uomo onesto. 
No! La magistratura può fare solo accertamenti di carattere giudiziale. Le 
istituzioni hanno il dovere di estromettere gli uomini politici vicini alla 
mafia, per essere oneste e apparire tali"

"There is a basic misunderstanding. It is said that political mafia has had 
acquaintances, if not found guilty by the courts, is an honest man. No. The 
judiciary can only do the findings of a judicial nature. Institutions have a 
duty to oust politicians close to the mafia, to be honest, these look "

Paolo Borsellino


_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to