-
Notifications
You must be signed in to change notification settings - Fork 18
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
doRisize() stopped working. #13
Comments
Yes - having the same problem - was working before and now stopped :-( |
Thank you for your comment. When I tested the following script using this library, no error occurs. const fileId = "###"; // File ID of a PNG image.
const res = ImgApp.doResize(fileId, 100); When this script is run, {
"blob":{},
"identification":"PNG",
"originalwidth":600,
"originalheight":375,
"resizedwidth":100,
"resizedheight":62
} Unfortunately, I cannot replicate your situation. I apologize for this. But, I would like to try to correctly replicate your situation. So, can you provide detailed information for correctly replicating it? |
Thank you so much for getting back to me so fast!
I am running the following code calling version 9 of ImgApp
function resize_Image(newFile,newImageWidth){
//copy the file to new folder
//resize the file
var newFileID=newFile.getId();
var blob=newFile.getBlob();
var res=ImgApp.getSize(blob);
if (res.width<=newImageWidth){
//nothing to do size is correct
}else{
//fix the size
Logger.log('processSingleImage-Resizing File: '+newFileID);
var file={
title:newFile.getName(),
mimeType: newFile.getMimeType()
};
var newRes=ImgApp.doResize(newFileID,newImageWidth);
//Update the new file
Drive.Files.update(file,newFileID,newRes.blob);
}
}
The only thing that might be causing this is that the file resides on a
shared drive - and I think that's the problem. I just tried to run it with
a file on my drive and it works, but from a shared drive it doesn't. :-(
Was that already mentioned somewhere and I missed it?
Sorry if I did. I didn't mean to waste your time.
Laurie
PS - I love this script by the way - it has been so great for automating
people uploading images and then fixing the size for output.
…On Thu, Jan 26, 2023 at 3:01 PM Kanshi TANAIKE ***@***.***> wrote:
Thank you for your comment. When I tested the following script using this
library, no error occurs.
const fileId = "###"; // File ID of a PNG image.const res = ImgApp.doResize(fileId, 100);
When this script is run, res of the returned value is as follows.
{
"blob":{},
"identification":"PNG",
"originalwidth":600,
"originalheight":375,
"resizedwidth":100,
"resizedheight":62
}
Unfortunately, I cannot replicate your situation. I apologize for this.
But, I would like to try to correctly replicate your situation. So, can you
provide detailed information for correctly replicating it?
—
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANFCOGN3IOHHYHGYZLNVQQ3WUJRPZANCNFSM6AAAAAAT5NDXTE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Thank you for replying. From your reply, I added a query parameter for using the files on the shared drive. And updated this library to v1.3.2. Please confirm it. When I tested this, no error occurs. If you have no permission for opening the file on the shared drive, an error occurs. Please be careful about this. |
I am working on a tool that works with HtmlSerivce in GAS to shrink images.
The doRisize(), which used to work, does not run and gives the following error.
On the other hand, in the test environment (different script ID) with the exact same source,
doResize() runs and shrinks the image.
Note that getSize() is still available in the same environment.
Do you have any idea what the cause might be?
The text was updated successfully, but these errors were encountered: