Skip to content

Commit

Permalink
Merge pull request #88 from Lehonti/improvement6
Browse files Browse the repository at this point in the history
Removed unnecessary variable in `ImageHelper.GetExtension`
  • Loading branch information
umaranis authored Sep 6, 2023
2 parents 9368442 + a37d33a commit 166adcb
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions MindMate/Model/ImageHelper.cs
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
using MindMate.Modules.Logging;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MindMate.Model
{
public static class ImageHelper
{
public static string GetExtension(Image image)
{
string ext;
{
if (image.RawFormat.Equals(ImageFormat.Bmp))
ext = "bmp";
return "bmp";
else if (image.RawFormat.Equals(ImageFormat.Gif))
ext = "gif";
return "gif";
else if (image.RawFormat.Equals(ImageFormat.Icon))
ext = "ico";
return "ico";
else if (image.RawFormat.Equals(ImageFormat.Jpeg))
ext = "jpg";
return "jpg";
else if (image.RawFormat.Equals(ImageFormat.Tiff))
ext = "tiff";
return "tiff";
else
ext = "png";

return ext;
return "png";
}

public const int IMAGE_DEFAULT_MAX_HEIGHT = 300;
Expand Down

0 comments on commit 166adcb

Please sign in to comment.