Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Added feature by issue.([Issue #1](https://github.com/overdrive1708/PhotoFrameGenerator/issues/1))
- Added feature by issue.([Issue #2](https://github.com/overdrive1708/PhotoFrameGenerator/issues/2))

[Unreleased]: https://github.com/overdrive1708/PhotoFrameGenerator
308 changes: 308 additions & 0 deletions NOTICE.md

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,19 @@
## アプリケーション概要
撮影時の情報を写真の周りに埋め込むアプリケーションです。

<img alt="加工後のサンプル画像" src="asetts/sample.JPG" height="400">

加工後のサンプル画像

## ダウンロード方法
[GitHubのReleases](https://github.com/overdrive1708/PhotoFrameGenerator/releases)にあるLatestのAssetsよりPhotoFrameGenerator_Ver.x.x.x.zipをダウンロードしてください。

## 使い方
T.B.D.
1. PhotoFrameGenerator.exeを実行します。
1. 加工したい画像ファイル(JPEG形式)を「入力ファイル追加」にドラッグ&ドロップします。
1. 表示させたいEXIF情報を選んで「生成」をクリックします。
1. 下部ステータスバーに「生成が完了しました。」と表示されたら完了です。
1. 加工したい画像ファイルと同じ場所に「framed-」が頭についたファイルが出来上がります。

## 開発環境
Visual Studio 2026 Community
Expand Down
Binary file modified asetts/ApplicationIcon.ico
Binary file not shown.
Binary file modified asetts/ApplicationIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added asetts/sample.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions src/PhotoFrameGenerator/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
x:Class="PhotoFrameGenerator.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Views/MainWindow.xaml">
<Application.Resources />
xmlns:ui="http://schemas.modernwpf.com/2019"
Startup="Application_Startup">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemeResources />
<ui:XamlControlsResources />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
19 changes: 18 additions & 1 deletion src/PhotoFrameGenerator/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows;
using PhotoFrameGenerator.Models;
using System.Windows;

namespace PhotoFrameGenerator
{
Expand All @@ -7,6 +8,22 @@ namespace PhotoFrameGenerator
/// </summary>
public partial class App : Application
{
/// <summary>
/// Startup処理
/// </summary>
/// <param name="sender">イベントソース</param>
/// <param name="e">イベントデータ</param>
private void Application_Startup(object sender, StartupEventArgs e)
{
// 未処理の例外が発生したときの処理を登録する。
DispatcherUnhandledException += ExceptionHandler.OnDispatcherUnhandledException;
TaskScheduler.UnobservedTaskException += ExceptionHandler.OnUnobservedTaskException;
AppDomain.CurrentDomain.UnhandledException += ExceptionHandler.OnUnhandledException;

// MainWindowを表示する。
MainWindow mainWindow = new();
mainWindow.Show();
}
}

}
85 changes: 85 additions & 0 deletions src/PhotoFrameGenerator/Models/ExceptionHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
using System.Diagnostics;
using System.IO;
using System.Windows;
using System.Windows.Threading;

namespace PhotoFrameGenerator.Models
{
/// <summary>
/// 例外ハンドラークラス
/// </summary>
public class ExceptionHandler
{
//--------------------------------------------------
// 定数
//--------------------------------------------------
/// <summary>
/// 例外情報記録ファイル
/// </summary>
private const string FatalErrorInformationPath = @"FatalErrorInformation.log";

/// <summary>
/// メモ帳の実行ファイル
/// </summary>
private const string NotepadPath = "notepad.exe";

//--------------------------------------------------
// メソッド
//--------------------------------------------------
/// <summary>
/// DispatcherUnhandledExceptionイベント発生時の処理
/// </summary>
/// <param name="sender">イベントソース</param>
/// <param name="e">イベントデータ</param>
public static void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) => HandleException(e.Exception);

/// <summary>
/// UnobservedTaskExceptionイベント発生時の処理
/// </summary>
/// <param name="sender">イベントソース</param>
/// <param name="e">イベントデータ</param>
public static void OnUnobservedTaskException(object ?sender, UnobservedTaskExceptionEventArgs e)
{
if (e.Exception.InnerException != null)
{
HandleException(e.Exception.InnerException);
}
}

/// <summary>
/// UnhandledExceptionイベント発生時の処理
/// </summary>
/// <param name="sender">イベントソース</param>
/// <param name="e">イベントデータ</param>
public static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) => HandleException((Exception)e.ExceptionObject);

/// <summary>
/// 例外発生時の処理
/// </summary>
/// <param name="e">例外情報</param>
private static void HandleException(Exception exception)
{
// 例外の詳細情報をファイルに出力する。
using (StreamWriter fatalErrorInformationFile = new(FatalErrorInformationPath, false, System.Text.Encoding.UTF8))
{
fatalErrorInformationFile.Write(exception.ToString());
fatalErrorInformationFile.Close();
}

// 例外の詳細情報を表示するか確認する。
MessageBoxResult result = MessageBox.Show(Resources.Strings.MessageFatalError,
Resources.Strings.ImportantNotice,
MessageBoxButton.YesNo,
MessageBoxImage.Error);

// 例外の詳細情報を表示する場合、ファイルに出力してメモ帳で開く。
if (result == MessageBoxResult.Yes)
{
_ = Process.Start(NotepadPath, FatalErrorInformationPath);
}

// 終了する。
Environment.Exit(1);
}
}
}
Loading
Loading