Uploaded image for project: 'Lucee Development'
  1. LDEV-1576

Saving of cfimage to Database stopped working in 5.2.4.37

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.2.4.37
    • Fix Version/s: 5.2.6.19
    • Labels:
      None
    • Environment:

      Windows, SQL Server

    • Sprint:
      January 2018 Sprint

      Description

      Error message happens when trying to save :
      Can't cast String [Illegal character padding in sequence to be decoded: [0, =, =, =]] to a value of type [binary] Java

      This problem is happening in code that has not been modified. The problem only occurs on version 5.2.4.37. When we use commandbox to specify any other previous lucee version, the code runs fine.

      We are copying an image, watermarking and resizing it, then converting it to a png file, and saving it to a SQL Server database. The database column is a varbinary(max)

      Code to create image (passGenerated is a cfimage variable):

      local.passThumbnail=ImageNew(arguments.args.passGenerated);
      // Add a "watermark"
      local.width=ImageGetWidth(local.passThumbnail);
      local.height=ImageGetHeight(local.passThumbnail);
      ImageSetDrawingColor(local.passThumbnail,"C6C6C6");
      ImageDrawLine(local.passThumbnail,0,0,local.width,local.height);
      ImageDrawLine(local.passThumbnail,0,local.height,local.width,0);
      ImageResize(local.passThumbnail,"20%","","highperformance");
      local.ppArgs.passThumbnail = local.passThumbnail.getImageBytes('png');
      Code that is saving it to the database:

      local.qInsert = queryExecute(
      " insert into pass_print_log
      (requestID,passThumbnail,logid)
      values
      (:requestID,:passThumbnail,:logID)",
      {
      requestID:

      {value: arguments.requestStruct.requestID, CFSQLType: 'CF_SQL_INTEGER'}

      ,
      passThumbnail:

      {value: arguments.requestStruct.passThumbnail, CFSQLType: 'CF_SQL_BLOB'}

      ,
      logID:

      {value: arguments.requestStruct.logID, CFSQLType: 'CF_SQL_BIGINT'}

      },

      { datasource: instance.gmsbox.name, result: "qResult" }

      );

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              cam.penner Cam Penner
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: