FLIR One Developer / Blog / Topics / LoadedFrame() : “File is not thermal image”

LoadedFrame() : “File is not thermal image”

Home Forums Android development Installation and getting started LoadedFrame() : “File is not thermal image”

This topic contains 1 reply, has 1 voice, and was last updated by Profile photo of Kevin Kevin 1 year, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)

  • Author

    Posts

  • #6136

    Profile photo of Kevin
    Kevin

    Participant

    Hi
    I bought FLIR One (Android) and tested. It has worked well.
    I have been developing Android App with FLIR SDK (flironesdk.aar).
    I imported the SDK and am testing on it.
    My question is that LoadedFrame() method returned “File is not thermal image”.
    I gave thermal image path I took with FLIR One to the method.<br /><br />
    When I tested sample app(FLIRONEExampleApplication) with the same thermal image file, it works well.

    I attached the code relating with above problem happens in LoadedFrame.class

    public FlirImage(String path) throws IllegalStateException {
    if(isImageIR(path)) {
    this.load(path);
    } else {
    throw new IllegalStateException(“File is not thermal image: ” + path);
    }
    }

    Even I used same thermal image file, sample app(FLIRONEExampleApplication) works well.
    But when I used the app I created and imported a FLIR SDK (flironesdk.aar) got failed in ‘isImageIR()’ function. The SDK is v3.0.1 and I am testing with Galaxy s7.

    I am looking forward to your response.
    Thanks.

    • This topic was modified 1 year, 8 months ago by Profile photo of Kevin Kevin.
    • This topic was modified 1 year, 8 months ago by Profile photo of Kevin Kevin.

    #6141

    Profile photo of Kevin
    Kevin

    Participant

    Hi
    I solved above issue.
    The problem was permission issue.
    I have tested with Galaxy s7(nougat). Android requires ‘Runtime Permission’ since Marshmallow(v6.0).
    Thus, it is not enough put below code to AndroidManifest.xml
    <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE”/>

    So, I added ‘Runtime Permission’ code in Activity and then it works well.
    I attached ‘Runtime Permission’ code.
    Thanks.

    // marshmallow and over version should check permission
    private void checkPermission() {
    if (Build.VERSION.SDK_INT >= 23){
    if (ContextCompat.checkSelfPermission(MainActivity.this,
    android.Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED )
    {
    ActivityCompat.requestPermissions(this,
    new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE}, 123);
    }
    }
    }

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.