FREN

Garoo


15 mar. 2004

So as to justify, in retrospect, the impulsive purchase of a TV capture card (that failed to help against my nascent depression), I’m adding a “zapping” section to the blog. I’m downloading ImageMagick1 right now (it’s available under Windows, now we’ll see if it works — in any case, it’s a long download), I’ll code the scripts during the night and, voilà, instant naked gymnasts on the site (that was on Canal+ this afternoon, and I thought it would not be nice to make captures… I hadn’t had the idea yet, apologies to my frustrated readers).

Actually, I’m announcing that though you won’t see much of it: most of the captures are unlikely to be relevant for foreign readers.

1: The capture program that comes with the card (and that is the only one I can get to work, partially because my video card fails to display video overlay) outputs BMP files. Since I have to process the image anyway in order to convert it (no way I can upload a BMP file for remote conversion, I’m on dialup), I might as well edit it as needed while I’m at it (cropping to remove the black borders, resizing — or not, I don’t know yet — and boosting contrast), with an automatic script so it’s simple and efficient. Otherwise I’m not going to post captures often.

P.S. It works. A .BAT file in the “Send to” menu to resize and move the picture to the desktop, an upload form that automatically generates the thumbnail, I’m ready to post lots of captures.

Oh, shoot, I forgot to improve contrast. But maybe I don’t need to after all.

Want to know when I post new content to my blog? It's a simple as registering for free to an RSS aggregator (Feedly, NewsBlur, Inoreader, …) and adding www.garoo.net to your feeds (or www.garoo.net if you want to subscribe to all my topics). We don't need newsletters, and we don't need Twitter; RSS still exists.

fielin, 8 years ago:

Allons bon, tu es en RTC. Mon univers s'effondre.

Nathou, 8 years ago:

Je suis épaté par un scripting dont j'ignore tout... Dis tu pourrais me l'envoyer ton fichier .BAT miracle ? Ce genre de fonction m'intéresse et je sais pas faire des .BAT... Je l'examinerais en cherchant une ref sur le net.... Ce serait cool !

garoo, 8 years ago:

Euh, je suis plutôt protecteur avec mes scripts, mais celui-là je peux même le mettre ici :)

(Je saute une ligne entre chaque ligne.)

@echo off

"F:\Program Files\ImageMagick-5.5.7-Q8\convert" %1 "F:\Documents and Settings\cedric\Bureau\TEMPORARY CAPTURE.BMP"

"F:\Program Files\ImageMagick-5.5.7-Q8\mogrify" -crop 744x558+10+8 -quality 60 -format jpeg -resize 640x480 "F:\Documents and Settings\cedric\Bureau\TEMPORARY CAPTURE.BMP"

del "F:\Documents and Settings\cedric\Bureau\TEMPORARY CAPTURE.BMP"

Première étape, prendre le fichier, peu importe son format (au cas où je changerais de programme de capture et le format de fichier source changerait) et le copier dans un fichier temporaire sur le bureau (important pour la suite).

Deuxième étape, le -crop enlèves les bordures noires ou bruiteuses, le -resize, ben, réduit un peu, et le reste convertir en JPEG.

Troisième étape, effacer le temporaire.bmp. Il ne reste plus qu'un temporaire.jpg sur le bureau.

Quatrième étape, je vais sur l'administration de mon site, je clique sur "Browse" pour récupérer le fichier (c'est pour ça qu'il est sur mon bureau, c'est plus direct pour le trouver) et le PHP fait le reste.

(Par contre, le source du PHP, je me le garde :))

garoo, 8 years ago:

Et le fichier "Capture TV.bat" est dans le répertoire "F:\Documents and Settings\cedric\SendTo\" pour apparaître dans le menu contextuel "Envoyer vers".

Nathou, 8 years ago:

Merci Garoo ! Je regarde regarderai ça en détail après mes partiels :-) C'est tout gentil de l'avoir rendu public ! Merci encore !

A. L., 8 years ago:

On dira ce qu'on voudra, mais un script bash c'est nettement mieux.

Legal information: This blog is hosted par OVH, 2 rue Kellermann, 59100 Roubaix, France, www.ovhcloud.com.

Personal data about this blog's readers are not used nor transmitted to third-parties. Comment authors can request their deletion by e-mail.

All contents © the author or quoted under fair use.