I am using MagicImage to convert heic to jpg, but for some reason it does not work. My UpdateClientFile method saving pictures that were sent here. So I need help to figure out what I am doing wrong. So I already implemented MagicImage code in my method.
private void UpdateClientFile(ClientFileType type, FileData newFile, int clientId, string fileName)
{
using (MagickImage image = new MagickImage(fileName))
{
string newFile12 = fileName.Replace(Path.GetExtension(fileName), ".jpg");
image.Write(newFile12);
}
Console.WriteLine("Processed file '{0}'.", fileName);
var currentFiles =
_clientFileService.Value.GetFilesByClient(clientId).Where(x => x.ClientFileType == type).Select(x => x.Id).ToList();
_clientFileService.Value.MultipleDelete(currentFiles, null);
_clientFileService
.Value
.AddFile(
new ClientFile
{
ClientId = clientId,
ClientFileType = type,
ContentType = newFile.ContentType,
Data = newFile.Data,
FileName = fileName,
DateChanged = DateTime.Now,
Guid = Guid.NewGuid()
});
}
Aucun commentaire:
Enregistrer un commentaire