Showing posts with label uwp. Show all posts
Showing posts with label uwp. Show all posts

Friday, 14 April 2017

Goodbye from Pix Casa

Hello fellow Pix Casa users!

I have decided that I will be ending support for Pix Casa and taking it off the marketplace. The app should still be "usable" for those of you that are currently using it for the time being, but no new users will be able to download it. I will no longer be providing updates or assist with any issues that are caused by the application. I suggest that you find alternative methods for viewing and backing up your photos.

This decision comes as the automatic backups have been less stable than they once were, and other users are also reporting similar issues. Without this key feature along with the reduced functionality of the app due to Google retiring Picasa, I don't see the same value the app once provided.

Thank you for supporting the app over the last two and a half years, which outperformed my initial expectations. I hope to see similar support for my current and any future projects I may release.

Monday, 12 September 2016

My Daily Wallpaper v1.1 Out Now

 A new update has been released for My Daily Wallpaper bringing it up to v1.1. The aim of this update was to improve the experience of the initial release, as well as pave the way for new features coming in the future. New stuff includes:
  • New Source Settings - XKCD source now supports retrieving random comics. This means you can now have  different XKCD goodness every day of the week. Perhaps even make My Daily Wallpaper an XKCD app? Bing source now also supports downloading HD versions of wallpapers on mobile (and SD versions on desktop).
  • Live Tile Support! - My Daily Wallpaper now displays the last seven days worth of wallpapers straight on your start menu or start screen. This works in similar way to the native photos app.
  • Dislike - Dislike today's wallpaper from within the app. It doesn't do much at the moment other than give you tips, but I plan to do more with this in a future update
  • Change Is Good - When changing today's wallpaper source or source settings, you no longer have to wait to the following week to see those settings applied and instead can apply them then and there.
  • Updates To How Wallpapers Are Set - XKCD comic now has a reduced brightness when applied as a wallpaper to help make other text more readable. Improvements have also been made to how wallpapers are set in the background, which means it should be more reliable. 
Now that this update is out of the way I plan to start work on some new sources for the app as well as flesh out the dislike functionality to be more useful.

EDIT: If you have any ideas for future functionality you're wanting to see, I'd love to hear about it via appstretch.

Sunday, 14 August 2016

UnauthorizedAccessException when deleting local files

While coding the first update for My Daily Wallpaper, I wanted to tackle some of the bugs reported by my users. According to the Windows Dev Dashboard, the top bug (by a long shot) was an UnauthorizedAccessException. Based on the logs this exception was caused by the wallpaper manager, which handles the downloading and setting of wallpapers based on user settings, where it would attempt to delete the old wallpaper.

foreach (StorageFile file in files)
{
    if (file.Name.StartsWith(LockscreenManager.OriginalFilenamePrefix, StringComparison.OrdinalIgnoreCase))
    {
        await file.DeleteAsync();
    }
}

The odd thing was, this error didn't occur all of the time and didn't have any clues as to why it did happen when it did.

I was stumped.

So I honed my Google-fu and managed to stumble upon a MS forum post which sounded a lot like mine.

It turns out, that when you reference a local file via the Image control in xaml, a lock is put on the file.

<Image source="Path/To/Local/File" />

This lock doesn't even seem to be taken off for while after navigating away from the page that includes said Image control.

The result - an UnauthorizedAccessException when attempting to delete the local file.

My solution to this problem is to use a converter to create the Source for the Image control by getting the file stream and loading it into a BitmapImage.

public class ImageSourceConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, string language)
    {
        string path = value as string;

        if (String.IsNullOrEmpty(path) == false)
        {
            var storageFile = StorageFile.GetFileFromPathAsync(path).AsTask().Result;

            var imageStream = storageFile.OpenStreamForReadAsync().Result;

            BitmapImage imgSource = new BitmapImage();

            imgSource.SetSource(imageStream.AsRandomAccessStream());

            return imgSource;
        }

        return null;
    }

    public object ConvertBack(object value, Type targetType, object parameter, string language)
    {
        throw new NotImplementedException();
    }
}