Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send manipulated images to temp media directory #874

Merged
merged 3 commits into from
Nov 13, 2023
Merged
Changes from 2 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
9 changes: 5 additions & 4 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 @@ -6076,8 +6076,9 @@ 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());
GxFile destinationImage = new GxFile(GxContext.StaticPhysicalPath(), destinationImageName);
string tempDirectory = Preferences.getTMP_MEDIA_PATH();
string destinationImageName = FileUtil.getTempFileName(tempDirectory, Path.GetFileNameWithoutExtension(sourceImage.GetName()), sourceImage.GetExtension());
GxFile destinationImage = new GxFile(tempDirectory, destinationImageName);
destinationImage.Create(ms);
destinationImage.Close();
destinationImagePath = destinationImage.GetAbsoluteName();
Expand Down
Loading