Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/image-url.jpg%20%22Optional%20title%22?q=image&page=82&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=image

Returns an array of strings in format "username" or "username/projectName"

Found 7101 results for "image"(508ms)

eink-frame-remixgenerateImageFromHtml.ts4 matches

@charmaine•Updated 1 week ago
2// API key required
3
4// TODO: Add caching of image
5export default async function generateImageFromHtml(
6 valUrl: string,
7 width: number = 800,
13 const apiKey = Deno.env.get("API_FLASH_KEY");
14 const generateUrl =
15 `https://api.apiflash.com/v1/urltoimage?access_key=${apiKey}&url=${valUrl}&width=${width}&height=${height}&format=png&fresh=true`;
16
17 try {
22 return response;
23 } catch (error) {
24 return new Response("Failed to generate image", { status: 500 });
25 }
26}

eink-frame-remixapod.ts1 match

@charmaine•Updated 1 week ago
8 service_version: string;
9 title: string;
10 url: string; // image to display
11};
12

pondiversemain3 matches

@argmn•Updated 1 week ago
2import deleteCreation from "./deleteCreation";
3import getCreation from "./getCreation";
4import getCreationImage from "./getCreationImage";
5import getCreations from "./getCreations";
6import updateTable from "./updateTable";
14 case "/get-creation":
15 return getCreation(req);
16 case "/get-creation-image":
17 return getCreationImage(req);
18 case "/get-creations":
19 return getCreations(req);

pondiversegetCreations2 matches

@argmn•Updated 1 week ago
12 // Iterate through each one and delete it's blob
13 for (const row of res.rows) {
14 blob.delete("pondiverse_image" + row.id);
15 }
16
53 // for (let creation of response.rows) {
54 // creation.url = `https://pondiverse.val.run/get-creation?id=${creation.id}`;
55 // creation.image = `https://pondiverse.val.run/get-creation-image?id=${creation.id}`;
56 // }
57

pondiversegetCreationImage1 match

@argmn•Updated 1 week ago
9 let response;
10 try {
11 response = await blob.get("pondiverse_image" + id);
12 } catch (e) {
13 return new Response(null, { status: 404 });

pondiversegetCreation1 match

@argmn•Updated 1 week ago
14 // This makes forking harder sorry
15 // creation.uri = `https://pondiverse.val.run/get-creation?id=${creation.id}`;
16 // creation.image = `https://pondiverse.val.run/get-creation-image?id=${creation.id}`;
17 return Response.json(creation);
18}

pondiversedeleteCreation1 match

@argmn•Updated 1 week ago
40
41 // Also delete the blob!
42 blob.delete("pondiverse_image" + id);
43
44 return Response.json({ ok: true });

stevensDemoREADME.md1 match

@tijs•Updated 1 week ago
3It's common to have code and types that are needed on both the frontend and the backend. It's important that you write this code in a particularly defensive way because it's limited by what both environments support:
4
5![shapes at 25-02-25 11.57.13.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/75db1d51-d9b3-45e0-d178-25d886c10700/public)
6
7For example, you *cannot* use the `Deno` keyword. For imports, you can't use `npm:` specifiers, so we reccomend `https://esm.sh` because it works on the server & client. You *can* use TypeScript because that is transpiled in `/backend/index.ts` for the frontend. Most code that works on the frontend tends to work in Deno, because Deno is designed to support "web-standards", but there are definitely edge cases to look out for.

stevensDemoREADME.md1 match

@tijs•Updated 1 week ago
21## `favicon.svg`
22
23As of this writing Val Town only supports text files, which is why the favicon is an SVG and not an .ico or any other binary image format. If you need binary file storage, check out [Blob Storage](https://docs.val.town/std/blob/).
24
25## `components/`

stevensDemoindex.ts15 matches

@tijs•Updated 1 week ago
73});
74
75// --- Blob Image Serving Routes ---
76
77// GET /api/images/:filename - Serve images from blob storage
78app.get("/api/images/:filename", async (c) => {
79 const filename = c.req.param("filename");
80
81 try {
82 // Get image data from blob storage
83 const imageData = await blob.get(filename);
84
85 if (!imageData) {
86 return c.json({ error: "Image not found" }, 404);
87 }
88
90 let contentType = "application/octet-stream"; // Default
91 if (filename.endsWith(".jpg") || filename.endsWith(".jpeg")) {
92 contentType = "image/jpeg";
93 } else if (filename.endsWith(".png")) {
94 contentType = "image/png";
95 } else if (filename.endsWith(".gif")) {
96 contentType = "image/gif";
97 } else if (filename.endsWith(".svg")) {
98 contentType = "image/svg+xml";
99 }
100
101 // Return the image with appropriate headers
102 return new Response(imageData, {
103 headers: {
104 "Content-Type": contentType,
107 });
108 } catch (error) {
109 console.error(`Error serving image ${filename}:`, error);
110 return c.json(
111 { error: "Failed to load image", details: error.message },
112 500,
113 );

Imagetourl2 file matches

@dcm31•Updated 22 hours ago

thilenius-webcam1 file match

@stabbylambda•Updated 5 days ago
Image proxy for the latest from https://gliderport.thilenius.com
Chrimage
Atiq
"Focal Lens with Atig Wazir" "Welcome to my photography journey! I'm Atiq Wazir, a passionate photographer capturing life's beauty one frame at a time. Explore my gallery for stunning images, behind-the-scenes stories, and tips & tricks to enhance your own