Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
HungryOctopus
Contributor III
Contributor III

Deal with metadata for pictures in Talend

Dear Community,

I am trying to find the best way to access metadata of pictures. 

The process looks like this: 

Job generates a preset from an original file > job loads the preset in a S3 Bucket > metadata about the preset is written in a database.

How can I access to the width and height of the new .jpg and write them as a tag in the S3Bucket? And if it's in a tag in the S3 Bucket, how can I get this information back in other Talend jobs?

Many thanks for your help.

Best regards,

Labels (2)
1 Solution

Accepted Solutions
Shicong_Hong
Employee
Employee

@HungryOctopus 

If you want to get the width and height of a .jpg, you can do it on a tJava component. eg:

BufferedImage bimg = ImageIO.read(new File("C:\\Users\jeremy\\Downloads\\JPEG_example_flower.jpg"));
int width          = bimg.getWidth();
int height         = bimg.getHeight();
System.out.println(width);
System.out.println(height);

bimg.flush();

Add the following imports in the Advanced settings panel:

import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;

if you want to add tag to S3 object before send it to the bucket, you can use the s3Put component (it have an option to specify tags). Note that this option is available from version R2024-01 onwards.

If you want to retrieve tags, please refer to the following scenario : 

Tagging S3 objects | Qlik Help Center

Regards

Shicong

 

 

 

View solution in original post

4 Replies
Shicong_Hong
Employee
Employee

@HungryOctopus 

If you want to get the width and height of a .jpg, you can do it on a tJava component. eg:

BufferedImage bimg = ImageIO.read(new File("C:\\Users\jeremy\\Downloads\\JPEG_example_flower.jpg"));
int width          = bimg.getWidth();
int height         = bimg.getHeight();
System.out.println(width);
System.out.println(height);

bimg.flush();

Add the following imports in the Advanced settings panel:

import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;

if you want to add tag to S3 object before send it to the bucket, you can use the s3Put component (it have an option to specify tags). Note that this option is available from version R2024-01 onwards.

If you want to retrieve tags, please refer to the following scenario : 

Tagging S3 objects | Qlik Help Center

Regards

Shicong

 

 

 

HungryOctopus
Contributor III
Contributor III
Author

Hey @Shicong_Hong 
I had to postpone that topic but today I looked into it and it works fine as you described.
Many thanks!

Graceleah4181
Contributor
Contributor

Thank you for the information.

Shicong_Hong
Employee
Employee

Glad to see it's working now, thank you for your feedback!

Regards

Shicong