×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jan 2013
    Posts
    5

    there is a bug in cameraexplorer

    cameraexplorer demo:https://projects.developer.nokia.com...aexplorer/wiki
    when debug the project,throw a exception in class:
    public class FlashModeParameter,the method:
    protected override void SetOption(ArrayParameterOption option)
    {
    Device.SetProperty(PropertyId, (FlashMode)option.Value);
    }
    exception stack trace:
    System.ArgumentException: Value does not fall within the expected range.
    at Windows.Phone.Media.Capture.PhotoCaptureDevice.SetProperty(Guid propertyId, Object value)
    at VaultApp.FlashModeParameter.SetOption(ArrayParameterOption option)
    at VaultApp.ArrayParameter.set_SelectedOption(ArrayParameterOption value)
    at VaultApp.FlashModeParameter.SetDefault()
    at VaultApp.CameraUserControl.<>c__DisplayClass1d.<InitializePhotoCamera>b__1c(Parameter parameter)

    now correct the type FlashMode to FlashState in this method:
    protected override void SetOption(ArrayParameterOption option)
    {
    Device.SetProperty(PropertyId, (FlashState)option.Value);
    }
    when debug ,project is runing well.

    and this demo cant run the htc samsung windows phone ,the demo will crash when runing these smart phone.

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2013
    Location
    Dublin, Ireland
    Posts
    552

    Re: there is a bug in cameraexplorer

    You can create a ticket (ie. file a bug) for that project and include the file that contains the fix, and I'm sure they'll update the repo.

  3. #3
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: there is a bug in cameraexplorer

    Hi Ding Young,

    Do you have the latest version of the source code? At https://projects.developer.nokia.com...ameter.cs#L690 you can see that FlashState is used correctly in the SetOptions method.

    At least on HTC the crash is caused by the KnownCameraGeneralProperties.AutoFocusRange issue discussed at http://social.msdn.microsoft.com/For...esolutions-and. The other issue discussed there, supported resolutions, may also cause a crash but only when choosing a bogus resolution value.

    Best regards,
    Last edited by ltomuta; 2013-08-07 at 20:33.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  4. #4
    Registered User
    Join Date
    Jan 2013
    Posts
    5

    Re: there is a bug in cameraexplorer

    Hi Itomuta,
    The latest source file is correct.the type FlashState is used in the SetOptions method of FlashModeParameter class.
    I Check the crash on the htc 8x through link you gived.

    Thank you.
    Best regards.

  5. #5
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: there is a bug in cameraexplorer

    Here's a quick fix for the crash in HTC. I don't have a Samsung phone, so I can only hope that if fixes the crash there too.
    Attached Files Attached Files
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  6. #6
    Registered User
    Join Date
    Jan 2013
    Posts
    5

    Re: there is a bug in cameraexplorer

    Thank you .
    Now I also have fixed the issue. First Check DeviceManufacturer is if "NOKIA" :string.Compare(DeviceExtendedProperties.GetValue("DeviceManufacturer").ToString(), "nokia", StringComparison.OrdinalIgnoreCase)==0

  7. #7
    Registered User
    Join Date
    Jan 2013
    Posts
    5

    Re: there is a bug in cameraexplorer

    Hi Itomuta
    in fix_htx.diff.txt,
    + if (!DeviceStatus.DeviceManufacturer.Contains("Nokia"))
    the snap code DeviceStatus.DeviceManufacturer.Contains("Nokia") always is equal false,because DeviceStatus.DeviceManufacturer is “NOKIA”.
    I think the "string.Compare(DeviceExtendedProperties.GetValue("DeviceManufacturer").ToString(), "nokia", StringComparison.OrdinalIgnoreCase)==0" is well.
    Last edited by Ding Young; 2013-08-08 at 11:32.

  8. #8
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: there is a bug in cameraexplorer

    Yep, I eventually went for
    Code:
    if (CultureInfo.InvariantCulture.CompareInfo.IndexOf(DeviceStatus.DeviceManufacturer, "Nokia", CompareOptions.IgnoreCase) == -1)
    {...}
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

Similar Threads

  1. Set Flash mode : on/off/auto with CameraExplorer sample
    By teerar.ssa in forum Windows Phone General
    Replies: 3
    Last Post: 2013-04-16, 15:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×