Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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,
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
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
Hey @Shicong_Hong
I had to postpone that topic but today I looked into it and it works fine as you described.
Many thanks!
Thank you for the information.
Glad to see it's working now, thank you for your feedback!
Regards
Shicong