Skip to content

Fix corrupted images in movies.json#27

Open
aleksandra-sturova wants to merge 2 commits intoVarvaraZadnepriak:masterfrom
aleksandra-sturova:fix/corrupted-images
Open

Fix corrupted images in movies.json#27
aleksandra-sturova wants to merge 2 commits intoVarvaraZadnepriak:masterfrom
aleksandra-sturova:fix/corrupted-images

Conversation

@aleksandra-sturova
Copy link

@aleksandra-sturova aleksandra-sturova commented Dec 21, 2022

Solution

From the initial JSON only about 500 images were valid. These were downloaded and saved.

After that iterated over the movies with broken images and requested new poster url from the movie db.
The new poster was downloaded and image name was replaced in the initial JSON.

Two movies had to be replaced:

  • one had invalid ID and was replaced by some random another movie (data contract stayed the same)
  • the other didn’t have poster at all so was replaced by another movie

The images zip can be loaded in EPAM cloud (attached link in a ticket in Teams).

Results

All the images were downloaded to the free cloud - see example here
https://pbqhlcnslsqajbeuwqil.supabase.co/storage/v1/object/public/images/mrw9NShY6I2FgXwk8Ge437pn08N.jpg
https://pbqhlcnslsqajbeuwqil.supabase.co/storage/v1/object/public/images/rK7m2Ba0ieXa37NaAmrx4dfRvvM.jpg

The images are working from Belarus.

Overall there’re now 3000 working images for the movies.

Supabase issue (resolution below)

The pricing here.

⚠️ The issue with it is the following:

Free projects are paused after 1 week of inactivity.

Basically, if the images are not requested for 7 days, but it's possible to restart the project.
However, this adds dependency on the owner of the base.

Some details also mentioned here:
https://www.reddit.com/r/Supabase/comments/v7j5ku/what_does_paused_mean/
https://supabase.com/docs/guides/platform/going-into-prod#availability

Nest step - discuss this with an owner of the React Mentoring Program.

Image kit 💚

Eventually, image kit was used for storing the images.

The images available by this url:

Whole library available here (requires credentials - shared with @Antontelesh):

The free plan is described here https://imagekit.io/plans/

Diff issue

Unfortunately, the JSON had a bit strange spacing (2 spaces and then 6 on the next line). So, had to adjust the spacing in json to be 2 and 4 on the next line.
That’s why the diff is not perfect, however, the order of elements stays the same and only the poster_path was replaced (sometimes just origin, sometimes whole url) along with 2 movies.

The diff in github is collapsed because it's way too big, but here's an example from local machine:

Screenshot 2022-12-21 at 17 05 56

@Antontelesh
Copy link

@aleksandra-sturova what do you think if we try to use EPAM Sharepoint for storing the images?

@aleksandra-sturova
Copy link
Author

@Antontelesh
Thought about this too, but sometimes links from sharepoint expire.

Screenshot 2022-12-22 at 11 10 11

Also, I've trie with one image and it looks like this
https://epam-my.sharepoint.com/:i:/p/aleksandra_sturova/EeGcTqIztnxKqpIiwXQV3tkBSWLNwWrXEWm1Lys5RM3abA?e=i1xJhf

which doesn't seem to be expectable.

So finally, tried with this service https://imagekit.io/

The image available by this url:
https://ik.imagekit.io/moviedb/posters/lZ6vZka2M0jtH1khYWa8j73E275_gh5pqz2_Me.jpg

Whole library available here (requires credentials):
https://imagekit.io/dashboard/media-library/L3Bvc3RlcnM?sort=DESC_CREATED&view=GRID
https://ik.imagekit.io/moviedb/posters/hibE8cyZs2Bm0o4WaWd1pppvjO2.jpg

The free plan is described here https://imagekit.io/plans/
I'll provide you with credentials to this base into personal messages.

Sound like should be fine.

Screenshot 2022-12-22 at 15 10 26

@aleksandra-sturova aleksandra-sturova marked this pull request as ready for review December 22, 2022 13:15
@Antontelesh
Copy link

The image available by this url:
https://ik.imagekit.io/moviedb/posters/lZ6vZka2M0jtH1khYWa8j73E275_gh5pqz2_Me.jpg

The link won't open for me. Otherwise I'm fine with going with imagekit.io for now. Will ask other programs what do they use for assets

@aleksandra-sturova
Copy link
Author

@Antontelesh
Sorry, I've uploaded a couple times and I added the wrong link in my comment!

The following url should be used for a poster:
https://ik.imagekit.io/moviedb/posters/7GSSyUUgUEXm1rhmiPGSRuKoqnK.jpg

The wrong one I've shared with you is from previous uploading which added "suffix" at the end after dash "_". So, it's no longer valid.

I've also updated PR description last week which contains correct links and other info about this DB.

@Antontelesh
Copy link

@VarvaraZadnepriak I guess this can be merged unless you have any objections

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants