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

Feature/5142 implement resize on upload for browser and easyimage #5144

Conversation

skamphuis
Copy link
Contributor

Closes #5142
Fixes #5143

This PR addresses 2 issues, because I ran into the second while fixing the first. #5143 looked critical, although I didn't get that one before.

Summary

The fix for #5143 is done by improving the ccode: before we would save the uploaded file, and when needed we'd resize it and save it again. Since the second save gave a "file in use" exception, I changed the code around so we're now first checking to see wether or not the file needs resizing. In any case we're only saving it once.

The fix for #5142 is done by implementing the logic for resizing on upload in FileUploader.ashx. In order to get that done, I needed the current editor settings there, and for that, I needed to add extra querystring parameters to the url for FileUploader.ashx.

I based this PR on the release/9.11.0 branch, hoping that's ok.

@skamphuis
Copy link
Contributor Author

Please note that I mostly copied the code to create the resized image from Browser.aspx.cs. At first I thought the would be quite a few differences, but that turned out out not to be the case. I wanted to put that in another class to only have one copy of that code, but I couldn't decide on which one, or to create a new one.

So, with a bit of advice on where to put htat, I'm happy to refactor that duplicate code out...

Copy link
Contributor

@donker donker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@donker donker merged commit ad73837 into dnnsoftware:release/9.11.0 Jul 5, 2022
@skamphuis skamphuis deleted the feature/5142-Implement-resize-on-upload-for-browser-and-easyimage branch November 23, 2022 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants