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

unable to use rezised images through public url #140

Closed
harshapulikollu opened this issue Dec 19, 2019 · 39 comments
Closed

unable to use rezised images through public url #140

harshapulikollu opened this issue Dec 19, 2019 · 39 comments
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers in-review Awaiting review by FE team. needs: author feedback Pending additional information from the author type: feature request New feature or request

Comments

@harshapulikollu
Copy link

[READ] Step 1: Are you in the right place?

Yes.

[REQUIRED] Step 2: Describe your configuration

  • Extension name: _ (storage-resize-images)
  • Extension version: _0.1.3

[REQUIRED] Step 3: I'm unable to access the resized images through a public(download) url from my flutter app, like I'm able to retrieve original image. I don't see any reason to use this extension if i can't access those resized images by manipulating the original Image URL.

please provide me a way how can I access those resized images from my flutter app.

@brandonpearcy
Copy link

+1 to this. I have not found a convenient way to make the resized images publicly accessible without doing manual post-processing with additional cloud functions.

The generated thumbs have no access token visible in Firebase console, there is no clickable link to view the images, and the preview of the image never loads (infinite spinner).

Screen Shot 2019-12-21 at 10 57 12 AM

I would expect that either:

(1) there exists a simple transformation from the original firebase storage URL to access the resized images (e.g., something you could hardcode in client logic), or
(2) this firebase extension comes with documentation describing how to best post-process the resized images to make them accessible

@NicolasMaas
Copy link

+1 to this. I have not found a convenient way to make the resized images publicly accessible without doing manual post-processing with additional cloud functions.

The generated thumbs have no access token visible in Firebase console, there is no clickable link to view the images, and the preview of the image never loads (infinite spinner).

I'm facing the same issue... Seems kind of pointless at the moment to use this extension at all.

@Ehesp Ehesp added documentation Improvements or additions to documentation type: feature request New feature or request labels Dec 23, 2019
@TiagoGouvea
Copy link

TiagoGouvea commented Jan 2, 2020

Happening with me also. Works fine on "dev" project but not on "prod" project. Both projects has billing activated.

On my "dev" project, sending a new image trough firebase console or by code, it generates the public URL of the resized file.

On my "prod" project it don't work.

  • Original file on prod project
  • Resized filename: 4433b4d7-f058-4aae-8faf-ffd11c42a4dd_650x500.jpg
  • Storage file: gs://guess-where-i-am.appspot.com/images/4433b4d7-f058-4aae-8faf-ffd11c42a4dd_650x500.jpg

The process full log:

Where-Am-I_–Functions–_Firebase_console

A console print with infinite loading:

Where-Am-I_–_Firebase_console

@smbowler
Copy link

smbowler commented Jan 6, 2020

Just FYI, I'm following along on this thread. I'm hoping a solution is found soon. Thanks

@smbowler
Copy link

smbowler commented Jan 7, 2020

Hi @Ehesp, happy New Year. I just wanted to check-in to see if there was a solution to this issue. It seems to be the same issue presented in #155

My development team paused development on our own solution when we found the firebase photo-resizing extension, but are awaiting your response to these two issues before we dedicate time to implementing and debugging.

Any insight would be greatly appreciated. Thank you!

@lars-sorensen
Copy link

I am also wondering this. Also wondering about the lack response here...

@anthowm
Copy link

anthowm commented Jan 23, 2020

In my backend I generate signedUrls dont like this way but also is weird that in my frontend I need to delay the get of resized images because it return to me 404 if not delay it for 2000 (the next times to access to resized images works without delay...).
When the original file works like a charm with signedUrl ...

First call is original file the second is the resized:
image

for (const resizeFile of urisArray) {
          const bucketFile = this.storage.file(resizeFile);
          const result = await bucketFile.getSignedUrl({
            action: 'read',
            expires: '01-01-2050',
          });
          resizedImages.push(result[0] ? result[0] : '');
        }

@karayu karayu added the in-review Awaiting review by FE team. label Jan 27, 2020
@rajgundluru rajgundluru added in-progress A fix or resolution is in progress and removed in-review Awaiting review by FE team. labels Jan 28, 2020
@NickFoden
Copy link

In the extension configuration steps within the firebase console, there needs to be an option to enable the access token for the created thumbnails or could/should even be defaulted to a valid access token similar to behavior of the regular file upload to storage.

This is crucial for being able to use this extension. Was searching on how to use the created thumbnails and have only hit dead ends. I am not sure which use case is currently being solved with this extension if the generated thumbnails are not available for use? Seems we have to go another direction for thumbnail generation for now. If anyone has any ideas how to access the thumbnails please ping me. Anyhow looking forward to future version of this image resize extension. Txs all.

@lsps9150414
Copy link

lsps9150414 commented Feb 11, 2020

@NickFoden Have been stuck with this as well. My workflow is:
Client upload to storage => resize extension => onStorageFinalize => cloud function to blur image & upload to storage again

So in the end, I have:

  • the original uploaded image
  • the resized images
  • the blurred images

I cannot find a solution to generate/get the downloadable URLs (containing the tokens) of the resized & blurred images in the context of my cloud function to store to my Firestore DB so I ended up with only storing the file path (the name prop. from the data object) in the DB and doing getDownloadURL on the client-side with the firebase client SDK, which is not ideal tho but is the only way I have found so far.

@DhavalW
Copy link

DhavalW commented Feb 28, 2020

+1 & I don't think this is a token access issue.

In my workflow, I'm serving some images & assets from a path fully open to public. ie Access rules are set to :

match /public/{allPaths=**}{
    	allow read, write;
    }

For every asset I manually construct the public url for this path, and purposely do not include any access tokens. So far all images were served just fine. However images generated by this extension are not served.

Unfortunately that's a deal killer for me, so i will have uninstall this extension & write my own image resizer. dread

@NickFoden
Copy link

NickFoden commented Feb 28, 2020

If you go find the new asset in your storage you can see the issue. Say you upload random.png go view in the web console and find it in storage. Expand file location and see an Access token

image

Now do the same thing for the generated thumbnail say random_200x200.png. There is no access token set, and so you will get a 403 trying to use it in your application unless you go enable it's access token manually. But no way I can do this for every single crop being uploaded. This was my experience a few weeks back trying this out. Will need to have the access token set up when the cropped image is created, same as a normal image uploaded gets a working access token.

@DhavalW
Copy link

DhavalW commented Feb 29, 2020

@NickFoden Yep. tried that just afterwards and you're right - it works once the token is enabled. & since its manual, doing so at scale is simply not an option.

But why does it occur even when auth requirements are disabled in rules ? that doesn't make sense. All other images on that path get served just fine without a token.

Also shouldn't this issue be marked as a bug ?

@Ehesp Ehesp added in-review Awaiting review by FE team. and removed in-progress A fix or resolution is in progress labels Mar 5, 2020
@Ehesp
Copy link
Member

Ehesp commented Mar 5, 2020

Implementation/fix details are being discussed. Once a decision has been made, I'll update this issue... Thanks for your patience!

@dfdgsdfg
Copy link

dfdgsdfg commented Mar 31, 2020

signedUrl error log with non exist token status

@anthowm same case here.

I create signedUrl with adminStorage.bucket(bucketName).file(filePath).getSignedUrl(options), but it does not work.

<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>
The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.
</Message>
<StringToSign>
GET 1895632947 /project.appspot.com/users/NK8bDKYlaofgwkX6cxy14tqpsGa2/room_backgrounds/room_bg_1584592936559_Ib6R9sawuIQ_200x200.jpeg
</StringToSign>
</Error>

If I create access token on web ui after created signedUrl, it still does not work.

@QuentinSc
Copy link

Hello,

No news ? :)

@DhavalW
Copy link

DhavalW commented Mar 31, 2020 via email

@K0EZ
Copy link

K0EZ commented Apr 4, 2020

this fix worked for me
https://stackoverflow.com/questions/59072882/cloud-functions-resized-images-not-loading/61023298#61023298

@devth
Copy link

devth commented Mar 27, 2021

I just installed this extension, and by default it looks like the resized images don't have tokens, so I can't see them in the Firebase Console. Is that expected?

@felix-lambert
Copy link

Yes same for me I don't have the public token url

@dackers86
Copy link
Member

Hi @devth @felix-lambert

I'll reopen this issue for investigation.

@dackers86 dackers86 reopened this Aug 5, 2021
@dackers86 dackers86 added this to Under consideration in Extension Update Tracker via automation Aug 5, 2021
@dackers86
Copy link
Member

Hi @devth @felix-lambert.

I am currently unable to replicate a missing token, can you confirm which version of the extension you are using?

The latest version is currently storage-resize-images@0.1.22

@dackers86 dackers86 moved this from Under consideration to Implementation in progress in Extension Update Tracker Aug 9, 2021
@dackers86 dackers86 added the needs: author feedback Pending additional information from the author label Aug 9, 2021
@dackers86 dackers86 moved this from Implementation in progress to Blocked in Extension Update Tracker Aug 10, 2021
@felix-lambert
Copy link

Hello thanks for your help. Yes I can confirm that the public token url is not available on the resized image in version 0.1.22. I only have the storage (gs://....png) but not the access token. The image with the original size has the access token but not the resized image.

@dackers86
Copy link
Member

Can you confirm that the File location tab on the right does not contain a token in Firebase storage?

Apologies if I am looking in the incorrect location.

@felix-lambert
Copy link

I have a file location tab. It contains: gs://.../mint.png for example but I don't have an Access token tab on the right for the resized image.

@dackers86
Copy link
Member

Hi @felix-lambert.

We have so far been unable to replicate this issue, if you are still experiencing an issues.

If you are still seeing this issue, would it be possible to generate screenshot of the screen where you missing a token, all other generated instances appear to display this token for all images.

@danaia
Copy link

danaia commented Oct 18, 2021

After a successful upload to my Firebase Bucket, I used to get my downloadURL just fine. Now, when using the resize extension, a new token is generated and I do not have access to the public image via the downloadURL - I tried to create my own uuid4 in metadata and still not working...

@dackers86 dackers86 added the good first issue Good for newcomers label Nov 23, 2021
@i14h
Copy link
Member

i14h commented Mar 29, 2022

@dackers86 lets reevaluate where we are on this

@dackers86
Copy link
Member

Possibly related #998

@dackers86 dackers86 moved this from Blocked to In review in Extension Update Tracker Jun 15, 2022
@dackers86 dackers86 moved this from In review to Launch approval pending in Extension Update Tracker Jun 30, 2022
@dackers86 dackers86 moved this from Launch approval pending to Launch ready in Extension Update Tracker Jul 26, 2022
@yamankatby
Copy link
Member

Happy to close this issue as completed as this feature is available now starting from v0.1.29 we have a config option to make images public that can be toggled during installation or by updating the extension config.

Screen Shot 2022-09-07 at 12 56 16

Feel free to reopen it if you still have issues with it

Extension Update Tracker automation moved this from Launch ready to Closed Sep 7, 2022
@CalvinJamesHeath
Copy link

@yamankatby I have it set to false but the images are still public. I'm I missing something?

@jauntybrain
Copy link
Contributor

Hi @CalvinJamesHeath! Could you please provide more information about this issue? Most importantly, what URL are you using to access the image?

@jauntybrain
Copy link
Contributor

@CalvinJamesHeath the only way I was able to replicate this behavior is when the Cloud Storage read permission is set to true (see screenshot below). Could you please verify your bucket's rules include the read permission set to false?

Screenshot 2024-02-21 at 12 07 29 PM

@CalvinJamesHeath
Copy link

The documentation explains that if no rule expression is provided, the rule evaluates to true. I see now. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers in-review Awaiting review by FE team. needs: author feedback Pending additional information from the author type: feature request New feature or request
Projects
Development

Successfully merging a pull request may close this issue.