Please advise if this generic algorithm is fine for loading all image types and save as all image types.
I also could load a dng to Image, then cast Image to RasterCachedImage and it works
But can’t cast that Image to RasterCachedMultipageImage
Using src As Image = Image.Load(sourceST, loadOpt)
Using rast As RasterCachedImage = TryCast(src, Aspose.Imaging.RasterCachedImage)
rast.CacheData
rast.Grayscale
rast.NormalizeHistogram
Select Case saveFormat
Case Dng
Using dest As FileFormats.Dng.DngImage = TryCast(rast, FileFormats.Dng.DngImage)
dest.Save...
Case Jpg
Using dest As FileFormats.Jpeg.JpegImage = TryCast(rast, FileFormats.Jpeg.JpegImage)
dest.Save...
... and go on ...
Is it fine for all formats?
Only Dng cannot cast to RasterCachedMultipageImage
Even Dng can cast to RasterCachedImage
Please show a workaround to cast Dng to RasterCachedMultipageImage
And perhaps a great idea to make it possible.
When Dng can cast to RasterCachedImage, then preventing RasterCachedMultipageImage is meaningless.
Hello, @australian.dev.nerds ,
Dng is a single page format so it can not be casted to RasterCachedMultipageImage. As concerns Dng metadata loss after exporting to Psd, Dng does not currently support metadata processing. Our apologies for any inconvenience.
Nice, because I tested that and it worked! Let’s see what your AI assistance told in this thread:
RasterCachedImage vs. RasterCachedMultipageImage:
If you are unsure whether the image is single or multi-page, it is safer to use RasterCachedMultipageImage. This way, you can handle both scenarios without issues, even if the current image is not multi-page.
I think it’s better you take some time to test and learn your own sdk first
@australian.dev.nerds ,
Unfortunately, our AI forum assistant answer was a bit incorrect. You may check an Image instance class using safe casting to avoid any exceptions.
You could also take a look at Imaging Api Reference:
Thanks, just please confirm the bug in the first post, black edges in the top/left corners when converting Dng images to other formats and assign the ticket no.
Also Dng contains important metadata/exif info, it’s a disaster when convcerting Dng to other formats those data are lost, not a bad idea to register a ticket for that.
Finally, do you know the magic number of Dng images for file detection?
Thanks.
@australian.dev.nerds
We did not manage to reproduce the issue with the black border in Dng. Would you mind to share an image sample, so we can reproduce the issue?
We have opened the following new ticket(s) for Dng matadata in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): IMAGINGNET-7665
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Hi,
Here you go, made by Adobe DNG itself from Canon RAW file, anyway, as you know, Dng files can have a thumbnail or preview jpec attached to them, once when converting from Dng, this preview small sized thumbnail was converted, instead of Dng itself, that’s not expected.
( This Dng does not have that preview thumbnail ) Dng.zip (185 Bytes)
After the conversion, please check the heavily darkened color tone of source vs destination.
Thanks, but reproducing the error can only take 5 minutes, anyway, there’s another bug in detection of DNG images, there are many DNG image files which are detected as TIFF by Aspose Imaging.
This sample is made by the latest version of Adobe DNG app, so… Dng2.zip (187 Bytes)
If you need a 100% accurate source code that detects and distinguish Dng vs Tiff please mark the thread as private and I’ll post here.
@australian.dev.nerds
We have opened the following new ticket(s) on Dng recognition issue in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): IMAGINGNET-7706
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@australian.dev.nerds ,
Yes, we managed to reproduce the black border issue using the attached Dng image and there is a created ticket in the related thread.