Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
ChristianGad  
#1 Posted : Tuesday, January 5, 2016 7:08:34 AM(UTC)
ChristianGad

Rank: Member

Groups: Member
Joined: 7/3/2005(UTC)
Posts: 5

Hi

I have some jpg images which makes the error "Invalid JPEG mark" when they are opened with Photoshop.

The image loads without errors i graphicsmill.bitmap. Is it possible to detect "invalid JPEG marker" in a image. Then I can save a new jpg file, and this has no errors in Photoshop

I don't want to open and save all images due to jpg compression. If it is the only solution then I have to do so.

Thanks

ChristianGad attached the following image(s):
img1450924440044_206448e07ef2bb8c703dd79_1.jpg
Fedor  
#2 Posted : Tuesday, January 5, 2016 9:06:23 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,558

Thanks: 5 times
Was thanked: 62 time(s) in 61 post(s)
Hi,

The following code should help you to detect damaged files:

Code:
try
{
	using (new Aurigma.GraphicsMill.Codecs.LosslessJpeg(@"corrupted.jpg"));
}
catch (Aurigma.GraphicsMill.Codecs.MediaCorruptedException ex)
{
	Console.Write(ex.Message);
}
Best regards,

Fedor Skvortsov

ChristianGad  
#3 Posted : Wednesday, January 6, 2016 3:05:29 AM(UTC)
ChristianGad

Rank: Member

Groups: Member
Joined: 7/3/2005(UTC)
Posts: 5

Thanks, It works perfect

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.