Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gifitti
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nick Kozel
Gifitti
Commits
5dd73f4c
Commit
5dd73f4c
authored
8 years ago
by
Riley Mcgee
Browse files
Options
Downloads
Patches
Plain Diff
Basic Refactoring and some code cleaning in model
parent
61a8dea0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Gifitti/Gifitti/Models/GifModel.cs
+18
-1
18 additions, 1 deletion
src/Gifitti/Gifitti/Models/GifModel.cs
src/Gifitti/Gifitti/View_Models/Form1.cs
+0
-1
0 additions, 1 deletion
src/Gifitti/Gifitti/View_Models/Form1.cs
with
18 additions
and
2 deletions
src/Gifitti/Gifitti/Models/GifModel.cs
+
18
−
1
View file @
5dd73f4c
...
...
@@ -3,8 +3,10 @@ using System;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Drawing.Imaging
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Threading.Tasks
;
namespace
Gifitti.Models
...
...
@@ -45,9 +47,13 @@ namespace Gifitti.Models
}
}
/// <summary>
/// Changes the loaded GIF to be what was originally loaded by the User.
/// If a new file is opened the current original GIF is overloaded.
/// </summary>
public
void
resetToOriginalGif
()
{
gifImage
=
originalGif
;
gifImage
=
originalGif
.
Clone
()
as
Image
;
}
/// <summary>
...
...
@@ -57,8 +63,19 @@ namespace Gifitti.Models
/// <param name="path">String representation of path to save the gif to.
/// Name and extension of gif mandatory.
/// </param>
/// <exception cref="DirectoryNotFoundException">
/// Thrown if the path is not valid for the local system,
/// OR the file has an extension other than [G|g][I|i][F|f]
/// </exception>
public
void
saveGif
(
string
path
)
{
//Error Handel on path
Regex
savePathTest
=
new
Regex
(
@"^(([^\/\\]+)[\/\\])*([^\/\\]*)\.[g|G][i|I][f|F]$"
);
if
(!
savePathTest
.
IsMatch
(
path
))
{
throw
new
DirectoryNotFoundException
();
}
//TODO take in image setting components as well as frames being viewed etc.
//Build GIF
using
(
MagickImageCollection
collection
=
new
MagickImageCollection
())
...
...
This diff is collapsed.
Click to expand it.
src/Gifitti/Gifitti/View_Models/Form1.cs
+
0
−
1
View file @
5dd73f4c
...
...
@@ -41,7 +41,6 @@ namespace Gifitti.View_Models
string
file
=
openFileDialog1
.
FileName
;
try
{
gm
=
new
GifModel
(
file
);
gm
.
ReverseAtEnd
=
false
;
Image
loadedGif
=
gm
.
gifImage
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment