Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Commit

Permalink
bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
liuziangexit committed Dec 25, 2017
1 parent 43d5627 commit df76012
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
18 changes: 18 additions & 0 deletions HEIF Utility English/Batch Conversion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ private void add_file_Click(object sender, EventArgs e)
T.IsBackground = true;
T.Start();

while (!box.IsHandleCreated)
Thread.Sleep(100);

var original = this.Text;
this.Text += " - Adding files";

Expand Down Expand Up @@ -339,6 +342,18 @@ private void HandleFormClosing(object sender, FormClosingEventArgs e)
}
}

private bool byte_array_starts_with(ref byte[] input, string value)
{
if (input.Length < value.Length)
return false;

for (int index = 0; index < value.Length; index++)
if (input[index] != value[index])
return false;

return true;
}

private void process(object input_temp_filename)
{
//获取临时文件名
Expand Down Expand Up @@ -381,6 +396,9 @@ private void process(object input_temp_filename)
else
write_this = invoke_dll.invoke_heif2jpg(heif_data, this.output_quality, temp_filename, ref copysize, true);

if (byte_array_starts_with(ref write_this, "HUD_ERR"))
throw new Exception("HUD_ERR");

FileStream fs = new FileStream(this.output_folder + "\\" + make_output_filename(list_copy[index_while]), FileMode.Create);
BinaryWriter writer = new BinaryWriter(fs);
try
Expand Down
9 changes: 9 additions & 0 deletions HEIF Utility English/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ private void 选择HEIFToolStripMenuItem_Click(object sender, EventArgs e)
T.IsBackground = true;
T.Start();

while (!box.IsHandleCreated)
Thread.Sleep(100);

open(filepicker.FileName);

box.Invoke(new Action(() =>
Expand Down Expand Up @@ -259,6 +262,9 @@ private void 另存为ToolStripMenuItem_Click(object sender, EventArgs e)
T.IsBackground = true;
T.Start();

while (!box2.IsHandleCreated)
Thread.Sleep(100);

try
{
int copysize = 0;
Expand Down Expand Up @@ -366,6 +372,9 @@ private void HU_DragDrop(object sender, DragEventArgs e)
T.IsBackground = true;
T.Start();

while (!box.IsHandleCreated)
Thread.Sleep(100);

open(((string[])e.Data.GetData(DataFormats.FileDrop, false))[0]);

box.Invoke(new Action(() =>
Expand Down

0 comments on commit df76012

Please sign in to comment.