How to add 'Description' to '.jpeg'?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Pawel Jastrzebski
el 20 de Mzo. de 2018
Comentada: Pawel Jastrzebski
el 21 de Mzo. de 2018
Once I've generated a plot and saved it as .jpeg, I'd like to add a description to it i.e.:
- 'This plot was created with script version 01'
The code for saving the plot is simple:
x = 0:0.1:4
fig(1) = figure
plot(x,x.^3)
saveas(fig(1),'fig.jpg')
And then I tried to access the image info to modify it but to no avail:
fileName = 'fig.jpg';
i = imread(fileName)
info = imfinfo(fileName)
info.Comment = 'Made with script version 1';
imwrite(i,'figC.jpg')
QUESTIONS:
- Is what I'm trying possible?
- If so, how?
Many thanks.
2 comentarios
Respuesta aceptada
C.J. Harris
el 20 de Mzo. de 2018
If you're only interested in the 'Comment' field, then you can set it directly:
imwrite(i,'figC.jpg', 'Comment', 'Made with script version 1')
1 comentario
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!