Skip to content

Commit

Permalink
Send manipulated images to temp media directory
Browse files Browse the repository at this point in the history
Issue: 104803
  • Loading branch information
tomas-sexenian committed Sep 14, 2023
1 parent 4959fe1 commit e20eb9e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5783,7 +5783,7 @@ private static Bitmap BitmapCreateFromStream(string filePathOrUrl)
{
try
{
byte[] data = httpClient.GetByteArrayAsync(filePathOrUrl).Result;
byte[] data = httpClient.GetByteArrayAsync(uri).Result;
using (MemoryStream mem = new MemoryStream(data))
{
return new Bitmap(mem);
Expand Down Expand Up @@ -5815,7 +5815,7 @@ private static Image ImageCreateFromStream(string filePathOrUrl)
{
try
{
byte[] data = httpClient.GetByteArrayAsync(filePathOrUrl).Result;
byte[] data = httpClient.GetByteArrayAsync(uri).Result;
using (MemoryStream mem = new MemoryStream(data))
{
return Image.FromStream(mem);
Expand Down Expand Up @@ -6054,6 +6054,7 @@ public static string FlipVertically(string imageFile)

public static string Save(Image bitmap, string imageFile, ImageFormat format)
{
System.Diagnostics.Debugger.Launch();
string destinationImagePath = string.Empty;
using (MemoryStream ms = new MemoryStream())
{
Expand All @@ -6076,7 +6077,7 @@ public static string Save(Image bitmap, string imageFile, ImageFormat format)
imageFile = Path.GetFileName(uri.AbsolutePath);
}
GxFile sourceImage = new GxFile(GxContext.StaticPhysicalPath(), imageFile);
string destinationImageName = FileUtil.getTempFileName(sourceImage.GetDirectory().GetAbsoluteName(), Path.GetFileNameWithoutExtension(sourceImage.GetName()), sourceImage.GetExtension());
string destinationImageName = FileUtil.getTempFileName(Preferences.getTMP_MEDIA_PATH(), Path.GetFileNameWithoutExtension(sourceImage.GetName()), sourceImage.GetExtension());
GxFile destinationImage = new GxFile(GxContext.StaticPhysicalPath(), destinationImageName);
destinationImage.Create(ms);
destinationImage.Close();
Expand Down

0 comments on commit e20eb9e

Please sign in to comment.