Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Certain files cause synchronisation to fail
Robin
#1 Posted : Friday, 29 July 2011 4:44:35 AM(UTC)
Robin

Rank: Member

Joined: 29/07/2011(UTC)
Posts: 4
Man
Location: Gravesend, Kent, UK

Exception Type: System.ArgumentException
Message: Value does not fall within the expected range.
Source: PresentationCore

I am adding my photos to Gallery Server Pro for the first time using the fourth method mentioned on page 64 of the administration guide, i.e. “change the media objects directory to an existing directory…”

Progress is halted when the program arrives at certain files. By the way I have noticed that the problematic file is not the one stated in the error message but the one after it in the folder.

I have found a workaround: set the hidden attribute on each problematic file to cause GSP to skip those files. But obviously that excludes them from the gallery.

However I have not been able to work out what it is about those files that GSP doesn’t like. They all open fine using various images viewers e.g. Windows Photo Gallery, QuckTime Picture Viewer. The metadata seems to display ok in the file properties dialog.

What is particularly annoying is that synchronisation for the entire gallery is halted by a single problematic file. A future enhancement to automatically skip and report files that cannot be handled would be good.

Any advice would be gratefully received.

Regards

Robin
Roger Martin
#2 Posted : Friday, 29 July 2011 5:51:50 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

Can you post the full stack trace of the error?

I will introduce an error handler to catch this type of error and gracefully continue with the sync.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Robin
#3 Posted : Friday, 29 July 2011 8:00:24 AM(UTC)
Robin

Rank: Member

Joined: 29/07/2011(UTC)
Posts: 4
Man
Location: Gravesend, Kent, UK

Full Error Log:

Error details


Url
http://localhost:33793/gs/services/Gallery.asmx/Synchronize


Timestamp
7/29/2011 2:38:30 PM


Exception Type
System.ArgumentException


Message
Value does not fall within the expected range.


Source
PresentationCore


Target Site
System.Windows.Media.SafeMILHandle SetupDecoderFromUriOrStream(System.Uri, System.IO.Stream, System.Windows.Media.Imaging.BitmapCacheOption, System.Guid ByRef, Boolean ByRef, System.IO.Stream ByRef, System.IO.UnmanagedMemoryStream ByRef, Microsoft.Win32.SafeHandles.SafeFileHandle ByRef)


Stack Trace
at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri, Stream stream, BitmapCacheOption cacheOption, Guid& clsId, Boolean& isOriginalWritable, Stream& uriStream, UnmanagedMemoryStream& unmanagedMemoryStream, SafeFileHandle& safeFilehandle)
at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache)
at System.Windows.Media.Imaging.BitmapDecoder.Create(Stream bitmapStream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption)
at GalleryServerPro.Business.WpfMetadataExtractor.GetBitmapMetadata(String imageFilePath)
at GalleryServerPro.Business.WpfMetadataExtractor.AddWpfBitmapMetadata(String imageFilePath, IGalleryObjectMetadataItemCollection metadataItems)
at GalleryServerPro.Business.Metadata.MediaObjectMetadataExtractor.GetGalleryObjectMetadataItemCollection()
at GalleryServerPro.Business.Image..ctor(Int32 id, IAlbum parentAlbum, String title, String hashKey, String thumbnailFilename, Int32 thumbnailWidth, Int32 thumbnailHeight, Int32 thumbnailSizeKb, String optimizedFilename, Int32 optimizedWidth, Int32 optimizedHeight, Int32 optimizedSizeKb, String originalFilename, Int32 originalWidth, Int32 originalHeight, Int32 originalSizeKb, Int32 sequence, String createdByUsername, DateTime dateAdded, String lastModifiedByUsername, DateTime dateLastModified, Boolean isPrivate, Boolean isInflated, FileInfo imageFile)
at GalleryServerPro.Business.Image..ctor(FileInfo imageFile, IAlbum parentAlbum)
at GalleryServerPro.Business.Factory.CreateImageInstance(FileInfo imageFile, IAlbum parentAlbum)
at GalleryServerPro.Business.Factory.CreateLocalMediaObjectInstance(FileInfo mediaObjectFile, IAlbum parentAlbum)
at GalleryServerPro.Business.Factory.CreateMediaObjectInstance(FileInfo mediaObjectFile, IAlbum parentAlbum, String externalHtmlSource, MimeTypeCategory mimeTypeCategory)
at GalleryServerPro.Business.SynchronizationManager.CreateNewMediaObject(IAlbum album, FileInfo file)
at GalleryServerPro.Business.SynchronizationManager.SynchronizeMediaObjectFiles(DirectoryInfo directory, IAlbum album)
at GalleryServerPro.Business.SynchronizationManager.Synchronize(String synchId, IAlbum album, String userName)
at Gsp.Gallery.Synchronize(Int32 albumId, String synchId, Boolean isRecursive, Boolean overwriteThumb, Boolean overwriteOpt, Boolean regenerateMetadata)


Inner Ex Type
System.ArgumentException


Inner Ex Message
Value does not fall within the expected range.


Inner Ex Source
<unknown>


Inner Ex Target Site
<unknown>


Inner Ex Stack Trace
<unknown>


App Error ID
51


Gallery ID
1


HTTP User Agent
Mozilla/5.0 (Windows NT 6.0) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30


Form Variables
<none>


Cookies
ASP.NET_SessionId: 0lpqxu2111pmabmglc0dvjpv
.ASPXAUTH: C0EDFFAB21DE59A2CF7CDC03C203F1F276CD517877791087ED8FA970601E765669938B34 FE8FAE1426947F8BF9E788E2102F56320BDE6A552A6788BE128543E4FAECFC28B60C989 717EA2C27484E146BFA6CDECE60CFE8E6EF27D9F9A650E1559600D7283981ADAD2D74BF F5A9B4A9F2515FA5AC672F27086801673216B3E8D69B02D3B4026CE76A38BA7C663C44B 703


Session Variables
ReferringUrl: http://localhost:33793/default.aspx?aid=279
HostUrl: http://localhost:33793
0lpqxu2111pmabmglc0dvjpv_admin_Profile: GalleryServerPro.Business.UserProfile


Server Variables
ALL_HTTP: HTTP_CONNECTION:keep-alive
HTTP_CONTENT_LENGTH:155
HTTP_CONTENT_TYPE:application/json; charset=UTF-8
HTTP_ACCEPT:*/*
HTTP_ACCEPT_CHARSET:ISO-8859-1,utf-8;q=0.7,*;q=0.3
HTTP_ACCEPT_ENCODING:gzip,deflate,sdch
HTTP_ACCEPT_LANGUAGE:en-US,en;q=0.8
HTTP_COOKIE:ASP.NET_SessionId=0lpqxu2111pmabmglc0dvjpv; .ASPXAUTH=C0EDFFAB21DE59A2CF7CDC03C203F1F276CD517877791087ED8FA970601E76 5669938B34FE8FAE1426947F8BF9E788E2102F56320BDE6A552A6788BE128543E4FAECF C28B60C989717EA2C27484E146BFA6CDECE60CFE8E6EF27D9F9A650E1559600D7283981 ADAD2D74BFF5A9B4A9F2515FA5AC672F27086801673216B3E8D69B02D3B4026CE76A38B A7C663C44B703
HTTP_HOST:localhost:33793
HTTP_REFERER:http://localhost:33793/default.aspx?g=task_synchronize&aid= 279
HTTP_USER_AGENT:Mozilla/5.0 (Windows NT 6.0) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30
HTTP_ORIGIN:http://localhost:33793
HTTP_X_REQUESTED_WITH:XMLHttpRequest
ALL_RAW: Connection: keep-alive
Content-Length: 155
Content-Type: application/json; charset=UTF-8
Accept: */*
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: ASP.NET_SessionId=0lpqxu2111pmabmglc0dvjpv; .ASPXAUTH=C0EDFFAB21DE59A2CF7CDC03C203F1F276CD517877791087ED8FA970601E76 5669938B34FE8FAE1426947F8BF9E788E2102F56320BDE6A552A6788BE128543E4FAECF C28B60C989717EA2C27484E146BFA6CDECE60CFE8E6EF27D9F9A650E1559600D7283981 ADAD2D74BFF5A9B4A9F2515FA5AC672F27086801673216B3E8D69B02D3B4026CE76A38B A7C663C44B703
Host: localhost:33793
Referer: http://localhost:33793/default.aspx?g=task_synchronize&aid=279
User-Agent: Mozilla/5.0 (Windows NT 6.0) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30
Origin: http://localhost:33793
X-Requested-With: XMLHttpRequest
APPL_MD_PATH: /LM/W3SVC/2/ROOT
APPL_PHYSICAL_PATH: C:\Users\Robin\Documents\My Web Sites\gallery\
AUTH_TYPE: Forms
AUTH_USER: admin
AUTH_PASSWORD:
LOGON_USER: admin
REMOTE_USER: admin
CERT_COOKIE:
CERT_FLAGS:
CERT_ISSUER:
CERT_KEYSIZE:
CERT_SECRETKEYSIZE:
CERT_SERIALNUMBER:
CERT_SERVER_ISSUER:
CERT_SERVER_SUBJECT:
CERT_SUBJECT:
CONTENT_LENGTH: 155
CONTENT_TYPE: application/json; charset=UTF-8
GATEWAY_INTERFACE: CGI/1.1
HTTPS: off
HTTPS_KEYSIZE:
HTTPS_SECRETKEYSIZE:
HTTPS_SERVER_ISSUER:
HTTPS_SERVER_SUBJECT:
INSTANCE_ID: 2
INSTANCE_META_PATH: /LM/W3SVC/2
LOCAL_ADDR: ::1
PATH_INFO: /gs/services/Gallery.asmx/Synchronize
PATH_TRANSLATED: C:\Users\Robin\Documents\My Web Sites\gallery\gs\services\Gallery.asmx
QUERY_STRING:
REMOTE_ADDR: ::1
REMOTE_HOST: ::1
REMOTE_PORT: 49367
REQUEST_METHOD: POST
SCRIPT_NAME: /gs/services/Gallery.asmx
SERVER_NAME: localhost
SERVER_PORT: 33793
SERVER_PORT_SECURE: 0
SERVER_PROTOCOL: HTTP/1.1
SERVER_SOFTWARE: Microsoft-IIS/7.5
URL: /gs/services/Gallery.asmx
HTTP_CONNECTION: keep-alive
HTTP_CONTENT_LENGTH: 155
HTTP_CONTENT_TYPE: application/json; charset=UTF-8
HTTP_ACCEPT: */*
HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.3
HTTP_ACCEPT_ENCODING: gzip,deflate,sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_COOKIE: ASP.NET_SessionId=0lpqxu2111pmabmglc0dvjpv; .ASPXAUTH=C0EDFFAB21DE59A2CF7CDC03C203F1F276CD517877791087ED8FA970601E76 5669938B34FE8FAE1426947F8BF9E788E2102F56320BDE6A552A6788BE128543E4FAECF C28B60C989717EA2C27484E146BFA6CDECE60CFE8E6EF27D9F9A650E1559600D7283981 ADAD2D74BFF5A9B4A9F2515FA5AC672F27086801673216B3E8D69B02D3B4026CE76A38B A7C663C44B703
HTTP_HOST: localhost:33793
HTTP_REFERER: http://localhost:33793/default.aspx?g=task_synchronize&aid=279
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.0) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30
HTTP_ORIGIN: http://localhost:33793
HTTP_X_REQUESTED_WITH: XMLHttpRequest
Robin
#4 Posted : Friday, 29 July 2011 8:14:11 AM(UTC)
Robin

Rank: Member

Joined: 29/07/2011(UTC)
Posts: 4
Man
Location: Gravesend, Kent, UK

Update:

I had guessed the problem with the files might be related to the fact they date back to 1999 and were taken on a digital camera of that time (a Kodak) as those taken more recently on my Canon generally seem fine. However, synchronization has again failed this afternoon - this time on JPG's taken from a stone supplier's web site - sample attached. Maybe you can see something about this file that would trip up your code.
Robin attached the following image(s):
Robin attached the following image(s): ruby_red_500.jpg
Roger Martin
#5 Posted : Friday, 29 July 2011 8:26:29 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

Have you tried the patch? That error looks like one that I already addressed.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Robin
#6 Posted : Friday, 29 July 2011 10:07:44 AM(UTC)
Robin

Rank: Member

Joined: 29/07/2011(UTC)
Posts: 4
Man
Location: Gravesend, Kent, UK

Hi Roger,

Brilliant! I've re-synchronized the folder containing the problem files and all is well. So far so good. Sorry I didn't spot the info. about the patch first. I'll now restart synchronization again on my entire gallery of nearly 8000 files and let you if I come across any more problems.

Robin

PS 10pm BST and 6542 of 7627 objects synchronized! Looking forward to integrating this into my new home Intranet for the family to enjoy, and hopefully I'll learn a few things along the way.
Rss Feed  Atom Feed
Users browsing this topic
Guest
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.