Home Image-Pro Automation (Macros, Apps, Reports)

Calibration not being saved with TIF IMAGE in PREMIER 9.2 . . .

All --

Is there any option or flag within PREMIER 9.2 that would keep a PREMIER CALIBRATION from being saved within a TIF IMAGE using the code below?

Additional Information:

** The ACTIVE IMAGE was originally opened from a JPG IMAGE FILE
** The ACTIVE IMAGE shows an ACTIVE CALIBRATION other than PIXEL (UNCALIBRATED)
** The SAVE AS ROUTINE does generate a TIF IMAGE FILE
** The IMAGE TITLE BAR still shows the JPG FILE NAME after the SAVE AS ROUTINE runs

This issue does not seem to happen if the ACTIVE IMAGE was opened from a TIF IMAGE FILE.

Thanks.

-- Matt

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
                        'Call the SAVE AS function
                        With Application.DocumentCommands.SaveAs(Nothing)
                            .FileName = _
                                myfullfilename
                            .Run(ThisApplication.ActiveImage)
                        End With

Best Answer

  • Answer ✓
    Hi Matt,

    Thank you for providing the test project. I was able to reproduce the problem and we will be working on fixing that.
    Meanwhile you can use the following workaround to make it work properly.
    Add this line:
    ThisApplication.ActiveImage.File.Format="tif"
    before executing SaveAs command:
        Public Sub Prog_SaveTester2()
    
            ThisApplication.Output.PrintMessage("Prog_CalibrationTester -- START")
    
            'Create the name for the CALIBRATED IMAGE
            Dim MyFullFileName As String = _
                "C:\ForumQuestion\NEWLY SAVED IMAGE.TIF"
    
            Try
                'workaround to save JPG image to TIF file with calibration, switch to TIF writer
                ThisApplication.ActiveImage.File.Format="tif"
    
                'set file name first
                ThisApplication.ActiveImage.File.FullPathName=MyFullFileName
                With Application.DocumentCommands.SaveAs(Nothing)
                    .FileName = _
                        MyFullFileName
                    .Run(ThisApplication.ActiveImage)
                End With
    ...

    Yuri

Answers

  • Hi Matt,

    I cannot reproduce your problem, calibration is always saved to TIF file. Do you see the problem saving image manually (using menu)?

    Yuri
  • edited July 2016
    Yuri --

    Thank you for your reply.

    The issue does not seem to happen when I do the CALIBRATION and SAVE AS using the PREMIER 9.2 USER INTERFACE.

    I have created and attached a DOCX FILE that includes SCREEN CAPTURES to document that success.

    Any chance we could WEBEX so you could see this happen "live"?

    Thanks again.

    -- Matt
  • Hi Matt,

    It's difficult to see what you do looking at the doc and when you mentioned that it works correctly from the UI. Maybe the problem is in the macro, you should check whether you use the right file name and the right document applying the calibration and saving the image. If everything looks correct, can you please create a simple macro that reproduces the problem and send it to me as IPX file, so I can debug it and check where the problem is?

    Thanks,

    Yuri

  • Yuri --

    Will do.

    Thanks.

    -- Matt
  • Yuri --

    Per your request, I have created code that illustrates the CALIBRATION ISSUE that I asked about on 11-JUL.

    The code is attached as

        ForumQuestion -- 2016-07-14-181403.ipx

    I have also attached the EXAMPLE JPG IMAGE FILE and a DOCX WINWORD FILE that shows the SCREEN CAPTURES that document the results on my computer.

    I hope these materials help you and yours identify and resolve the issue.

    Thank you for your assistance.

    -- Matt

    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-

  • Yuri --

    Two more things . . . .

    Please note that after the SAVE AS OPERATION, the TITLE BAR of the ORIGINAL IMAGE does not change

    and

    When attempting a MANUAL CLOSE on the ORIGINAL IMAGE, PREMIER thinks it has not been saved even though it HAS been saved.

    See below.

    Thanks.

    -- Matt

    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-


  • Yuri --

    Thank you for looking into this an providing a WORK AROUND.

    I'll wire that into the code and remove the multiple APPLY CALIBRATIONS that are currently wired in.

    Thanks again.

    -- Matt
Sign In or Register to comment.