I'm have application that gets image in binnary format. Then this application must convert this image to specific dimmension and save both form (orginal and specific) to disk. In this case application must store info about this picture in database too.
Where put the logic of conversion: in application layer, in domain layer or maybe in infrastructure layer?
You should put conversion logic into infrastructure layer unless Your domain is about converting images.
Something like this:
//domain
public class Image{
public Image(string fileName){
FileName=fileName;
}
public string FileName{get;private set;}
}
//infrastructure
public class ImageConvertor:ICanConvertImages{
public byte[] BmpToJpeg(byte[] img){
throw new NotImplementedException("haa haa");
}
}
//application
var bmpImg=PullBytesFromNowhere();
var jpegImg=convertor.BmpToJpeg(img);
var fileName=SaveToFile(jpegImg);
var image=new Image(fileName);