This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Error 1 at JPEG File VI Function When Loading an Image Path in LabVIEW

Updated Jun 11, 2023

Reported In

Software

  • LabVIEW
  • Vision Development Module

Issue Details

I am using LabVIEW development environment to open a JPEG image using Read JPEG file VI by inputting the file path. Once the function is being executed I get a pop-up with the message 
Error 1 occurred at Read JPEG File.vi
image.png
What is the reason I am getting this error and how can I solve it?

Solution

Here are the possible solutions for the issue:

 

1. Rename the file

As the error message implies, make sure you do not use special characters such as ? or @. In order to make sure the characters are allowed is to rename the file to a simple name such as image
 

2. Check file path permissions

Another reason for this error can be image path permissions (if you have built an application). Make sure you have access to the path of the image. To make sure you have the permission, please run the application as Administrator. For more information or steps for the file permission issue, please refer to the following article: Error 1 When Building Executable in LabVIEW.
 

3. Check the image bit depth

Make sure the image bit depth meets the requirements of the Read JPEG file VI function. According to the VI documentation, valid values include 1, 4, 8, and 24 bits per pixel. To check whether your JPEG file suits the requirements, please follow the below steps:
  1. Open the JPEG file directory from the file explorer
  2. Right click on the JPEG file
  3. Select Properties
  4. Click on the Details tab
  5. Scroll down until you see the bit depth parameter. See the screenshot below:
image.png

The JPG file shown above can not be used by Read JPEG file VI. In order to use it with LV it is recommended one of the following:
  • Use third party software to change the bit depth of the image (e.g. Adobe Photoshop)
  • Convert the JPEG file to PNG and use Read PNG file VI, as it supports 32 bit depth images.